Struct fiberplane_models::notebooks::operations::CellReplaceText
source · #[non_exhaustive]pub struct CellReplaceText {
pub offset: u32,
pub new_text: String,
pub new_formatting: Option<Formatting>,
pub old_text: String,
pub old_formatting: Option<Formatting>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.offset: u32Starting offset where we will be replacing the text.
Please be aware this offset refers to the position of a Unicode Scalar Value (non-surrogate codepoint) in the cell text, which may require additional effort to determine correctly.
new_text: StringThe new text value we’re inserting.
new_formatting: Option<Formatting>Optional formatting that we wish to apply to the new text.
Offsets in the formatting are relative to the start of the new text.
old_text: StringThe old text that we’re replacing.
old_formatting: Option<Formatting>Optional formatting that was applied to the old text. This should be all the formatting
annotations that were inside the old_text before this operation was applied. However,
it is at the operation’s discretion whether or not to include annotations that are at the
old text’s boundaries.
Offsets in the formatting are relative to the start of the old text.
Implementations§
source§impl CellReplaceText
impl CellReplaceText
sourcepub fn builder() -> CellReplaceTextBuilder<((), (), (), (), ())>
pub fn builder() -> CellReplaceTextBuilder<((), (), (), (), ())>
Create a builder for building CellReplaceText.
On the builder, call .offset(...), .new_text(...)(optional), .new_formatting(...)(optional), .old_text(...)(optional), .old_formatting(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of CellReplaceText.
Trait Implementations§
source§impl Clone for CellReplaceText
impl Clone for CellReplaceText
source§fn clone(&self) -> CellReplaceText
fn clone(&self) -> CellReplaceText
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for CellReplaceText
impl Debug for CellReplaceText
source§impl<'de> Deserialize<'de> for CellReplaceText
impl<'de> Deserialize<'de> for CellReplaceText
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for CellReplaceText
impl PartialEq for CellReplaceText
source§fn eq(&self, other: &CellReplaceText) -> bool
fn eq(&self, other: &CellReplaceText) -> bool
self and other values to be equal, and is used
by ==.