diff --git a/src/lib.rs b/src/lib.rs index fbfb81c..6f9597b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -228,6 +228,7 @@ pub struct PageOptions<'a> { pub page_id: &'a str } +#[derive(Clone)] pub struct Pages { http_client: Arc, request_handler: Arc @@ -252,6 +253,7 @@ impl Pages { } } +#[derive(Clone)] pub struct Blocks { http_client: Arc, request_handler: Arc @@ -296,6 +298,7 @@ impl BlockChildren { } } +#[derive(Clone)] pub struct Databases { http_client: Arc, request_handler: Arc @@ -330,6 +333,7 @@ pub struct DatabaseQueryOptions<'a> { pub filter: Option } +#[derive(Clone)] pub struct Users { http_client: Arc, request_handler: Arc @@ -922,9 +926,22 @@ pub enum RichText { Text(Text, String), Mention(Mention, String), Equation(Equation, String), + Unsupported(String, Value) } +#[allow(unused)] +impl RichText { + pub fn plain_text(&self) -> String { + match self { + RichText::Text(_, text) | + RichText::Mention(_, text) | + RichText::Equation(_, text) | + RichText::Unsupported(text, _) => text.to_string() + } + } +} + impl TryFrom for RichText { type Error = Error;