Enum fiberplane_models::formatting::Annotation
source · #[non_exhaustive]pub enum Annotation {
}Expand description
A rich-text annotation.
Annotations are typically found inside a Formatting vector.
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.
StartBold
EndBold
StartCode
EndCode
StartHighlight
EndHighlight
StartItalics
EndItalics
Label(Label)
StartLink
EndLink
Mention(Mention)
StartStrikethrough
EndStrikethrough
Timestamp
StartUnderline
EndUnderline
Implementations§
source§impl Annotation
impl Annotation
sourcepub fn is_paired_annotation(&self) -> bool
pub fn is_paired_annotation(&self) -> bool
Returns whether the annotation is one of a Start*/End* pair.
sourcepub fn toggle_opposite(&self) -> Option<Annotation>
pub fn toggle_opposite(&self) -> Option<Annotation>
Returns the opposite of an annotation for the purpose of toggling the formatting.
Returns None if the annotation is not part of a pair, or if the
formatting cannot be toggled without more information.
Trait Implementations§
source§impl Clone for Annotation
impl Clone for Annotation
source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for Annotation
impl Debug for Annotation
source§impl<'de> Deserialize<'de> for Annotation
impl<'de> Deserialize<'de> for Annotation
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Annotation
impl PartialEq for Annotation
source§fn eq(&self, other: &Annotation) -> bool
fn eq(&self, other: &Annotation) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for Annotation
impl Serialize for Annotation
impl Eq for Annotation
impl StructuralPartialEq for Annotation
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnwindSafe for Annotation
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more