notion-sdk 0.0.0

A rust implementation of the nvd-yew.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::database::properties::PropertyValue;
use crate::pages::Page;

impl Page {
    /// get page's title
    pub fn get_title(&self) -> String {
        if let Some(PropertyValue::Title { title, .. }) = self.properties.properties.get("Title") {
            let tit: Vec<String> = title.iter().map(|r| r.plain_text().to_string()).collect();
            return tit.join("");
        }
        String::new()
    }
}