#[non_exhaustive]pub struct ReplaceTextOperation {
pub cell_id: String,
pub field: Option<String>,
pub offset: u32,
pub new_text: String,
pub new_formatting: Option<Formatting>,
pub old_text: String,
pub old_formatting: Option<Formatting>,
}Expand description
Replaces the part of the content in any content type cell or the title of a graph cell.
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.cell_id: StringID of the cell whose text we’re modifying.
field: Option<String>Field to update the text of.
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 ReplaceTextOperation
impl ReplaceTextOperation
sourcepub fn builder() -> ReplaceTextOperationBuilder<((), (), (), (), (), (), ())>
pub fn builder() -> ReplaceTextOperationBuilder<((), (), (), (), (), (), ())>
Create a builder for building ReplaceTextOperation.
On the builder, call .cell_id(...), .field(...)(optional), .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 ReplaceTextOperation.
Trait Implementations§
source§impl Clone for ReplaceTextOperation
impl Clone for ReplaceTextOperation
source§fn clone(&self) -> ReplaceTextOperation
fn clone(&self) -> ReplaceTextOperation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ReplaceTextOperation
impl Debug for ReplaceTextOperation
source§impl Default for ReplaceTextOperation
impl Default for ReplaceTextOperation
source§fn default() -> ReplaceTextOperation
fn default() -> ReplaceTextOperation
source§impl<'de> Deserialize<'de> for ReplaceTextOperation
impl<'de> Deserialize<'de> for ReplaceTextOperation
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 ReplaceTextOperation
impl PartialEq for ReplaceTextOperation
source§fn eq(&self, other: &ReplaceTextOperation) -> bool
fn eq(&self, other: &ReplaceTextOperation) -> bool
self and other values to be equal, and is used
by ==.