Struct Block

Source
pub struct Block {
Show 40 fields pub parent: Parent, pub object: String, pub id: String, pub created_time: String, pub last_edited_time: String, pub created_by: User, pub last_edited_by: User, pub archived: bool, pub in_trash: bool, pub type_name: String, pub has_children: bool, pub is_togglable: bool, pub bookmark: Option<Bookmark>, pub breadcrumb: Option<FxHashMap<String, String>>, pub bulleted_list_item: Option<BulletedListItem>, pub callout: Option<Callout>, pub child_database: Option<ChildDatabase>, pub child_page: Option<ChildPage>, pub code: Option<Code>, pub column_list: Option<FxHashMap<String, String>>, pub column: Option<FxHashMap<String, String>>, pub divider: Option<FxHashMap<String, String>>, pub embed: Option<Embed>, pub equation: Option<Equation>, pub file: Option<File>, pub heading_1: Option<Heading>, pub heading_2: Option<Heading>, pub heading_3: Option<Heading>, pub image: Option<Image>, pub link_preview: Option<LinkPreview>, pub numbered_list_item: Option<NumberedListItem>, pub paragraph: Option<Paragraph>, pub pdf: Option<Pdf>, pub quote: Option<Quote>, pub table: Option<Table>, pub table_row: Option<TableRow>, pub table_of_contents: Option<TableOfContents>, pub to_do: Option<ToDo>, pub toggle: Option<ToggleBlock>, pub video: Option<Video>,
}

Fields§

§parent: Parent§object: String§id: String§created_time: String§last_edited_time: String§created_by: User§last_edited_by: User§archived: bool§in_trash: bool§type_name: String§has_children: bool§is_togglable: bool§bookmark: Option<Bookmark>§breadcrumb: Option<FxHashMap<String, String>>§bulleted_list_item: Option<BulletedListItem>§callout: Option<Callout>§child_database: Option<ChildDatabase>§child_page: Option<ChildPage>§code: Option<Code>§column_list: Option<FxHashMap<String, String>>§column: Option<FxHashMap<String, String>>§divider: Option<FxHashMap<String, String>>§embed: Option<Embed>§equation: Option<Equation>§file: Option<File>§heading_1: Option<Heading>§heading_2: Option<Heading>§heading_3: Option<Heading>§image: Option<Image>§link_preview: Option<LinkPreview>§numbered_list_item: Option<NumberedListItem>§paragraph: Option<Paragraph>§pdf: Option<Pdf>§quote: Option<Quote>§table: Option<Table>§table_row: Option<TableRow>§table_of_contents: Option<TableOfContents>§to_do: Option<ToDo>§toggle: Option<ToggleBlock>§video: Option<Video>

Implementations§

Source§

impl Block

Source

pub fn bookmark( parent_type: ParentType, parent_id: String, caption: String, url: String, ) -> Self

Source

pub fn breadcrumb(parent_type: ParentType, parent_id: String) -> Self

Source

pub fn bulleted_list_item( parent_type: ParentType, parent_id: String, texts: Vec<String>, ) -> Self

Source

pub fn callout( parent_type: ParentType, parent_id: String, text: String, icon: Icon, color: Color, ) -> Self

Source

pub fn child_database( parent_type: ParentType, parent_id: String, title: String, ) -> Self

Source

pub fn child_page( parent_type: ParentType, parent_id: String, title: String, ) -> Self

Source

pub fn code( parent_type: ParentType, parent_id: String, caption: String, language: String, texts: Vec<String>, ) -> Self

Source

pub fn column_list(parent_type: ParentType, parent_id: String) -> Self

Source

pub fn column(parent_type: ParentType, parent_id: String) -> Self

Source

pub fn divider(parent_type: ParentType, parent_id: String) -> Self

Source

pub fn embed(parent_type: ParentType, parent_id: String, url: String) -> Self

Source

pub fn equation( parent_type: ParentType, parent_id: String, expression: String, ) -> Self

Source

pub fn file(parent_type: ParentType, parent_id: String) -> Self

Source

pub fn heading_1( parent_type: ParentType, parent_id: String, texts: Vec<String>, ) -> Self

Source

pub fn heading_2( parent_type: ParentType, parent_id: String, texts: Vec<String>, ) -> Self

Source

pub fn heading_3( parent_type: ParentType, parent_id: String, texts: Vec<String>, ) -> Self

Source

pub fn image(parent_type: ParentType, parent_id: String, url: String) -> Self

Source

pub fn numbered_list_item( parent_type: ParentType, parent_id: String, texts: Vec<String>, ) -> Self

Source

pub fn paragraph( parent_type: ParentType, parent_id: String, texts: Vec<String>, ) -> Self

Source

pub fn pdf(parent_type: ParentType, parent_id: String, url: String) -> Self

Source

pub fn quote( parent_type: ParentType, parent_id: String, texts: Vec<String>, ) -> Self

Source

pub fn table(parent_type: ParentType, parent_id: String) -> Self

Source

pub fn table_row( parent_type: ParentType, parent_id: String, cells: Vec<String>, ) -> Self

Source

pub fn table_of_contents(parent_type: ParentType, parent_id: String) -> Self

Source

pub fn to_do( parent_type: ParentType, parent_id: String, texts: Vec<String>, checked: bool, ) -> Self

Source

pub fn toggle_blocks( parent_type: ParentType, parent_id: String, texts: Vec<String>, ) -> Self

Source

pub fn video(parent_type: ParentType, parent_id: String, url: String) -> Self

Trait Implementations§

Source§

impl Clone for Block

Source§

fn clone(&self) -> Block

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Block

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Block

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Block

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Block

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Block

§

impl RefUnwindSafe for Block

§

impl Send for Block

§

impl Sync for Block

§

impl Unpin for Block

§

impl UnwindSafe for Block

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,