#[non_exhaustive]
pub enum Cell {
Show 13 variants Checkbox(CheckboxCell), Code(CodeCell), Discussion(DiscussionCell), Divider(DividerCell), Graph(GraphCell), Heading(HeadingCell), Image(ImageCell), ListItem(ListItemCell), Log(LogCell), Provider(ProviderCell), Table(TableCell), Timeline(TimelineCell), Text(TextCell),
}
Expand description

Representation of a single notebook cell.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Checkbox(CheckboxCell)

§

Code(CodeCell)

§

Discussion(DiscussionCell)

§

Divider(DividerCell)

§

Graph(GraphCell)

§

Heading(HeadingCell)

§

Image(ImageCell)

§

ListItem(ListItemCell)

§

Log(LogCell)

§

Provider(ProviderCell)

§

Table(TableCell)

§

Timeline(TimelineCell)

§

Text(TextCell)

Implementations§

source§

impl Cell

source

pub fn content(&self) -> Option<&str>

Returns the cell’s content, if any.

source

pub fn formatting(&self) -> Option<&Formatting>

Returns the cell’s formatting, if any.

source

pub fn supports_formatting(&self) -> bool

source

pub fn id(&self) -> &str

Returns the cell’s ID.

source

pub fn text(&self) -> Option<&str>

Returns the cell’s text, if any.

source

pub fn with_id(&self, id: &str) -> Self

Returns a copy of the cell with a new ID.

source

pub fn with_text(&self, text: impl Into<String>) -> Self

Returns a copy of the cell with its text replaced by the given text, without any formatting.

source

pub fn with_rich_text( &self, text: impl Into<String>, formatting: Formatting ) -> Self

Returns a copy of the cell with its text replaced by the given text and formatting.

Warning: For cell types that have text, but which do not support rich-text, the formatting will be dropped silently.

source

pub fn with_text_for_field<T>( &self, text: T, formatting: Option<Formatting>, field: Option<impl AsRef<str>> ) -> Self
where T: Into<String> + AsRef<str>,

Returns a copy of the cell with the text for the given field replaced by the given text and optional formatting.

If no field is given, the text is applied to the cell’s main text field, similar to with_text() or with_rich_text(), depending on whether any formatting is given.

Warning: For cell types that have text, but which do not support rich-text, any given formatting will be dropped silently.

source

pub fn id_mut(&mut self) -> &mut String

source

pub fn formatting_mut(&mut self) -> Option<&mut Formatting>

Returns a mutable reference to the formatting array if the cell type supports formatting.

source

pub fn text_mut(&mut self) -> Option<&mut String>

Returns a mutable reference to the cell’s text, if any.

source

pub fn type_str(&self) -> &str

Returns the cell type as a string

Trait Implementations§

source§

impl Clone for Cell

source§

fn clone(&self) -> Cell

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Cell

source§

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

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

impl<'de> Deserialize<'de> for Cell

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 PartialEq for Cell

source§

fn eq(&self, other: &Cell) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Cell

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
source§

impl StructuralPartialEq for Cell

Auto Trait Implementations§

§

impl Freeze for Cell

§

impl RefUnwindSafe for Cell

§

impl Send for Cell

§

impl Sync for Cell

§

impl Unpin for Cell

§

impl UnwindSafe for Cell

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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> BindgenSerializable for T

source§

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