Enum fiberplane_models::formatting::Annotation
source · #[non_exhaustive]
pub enum Annotation {
Show 17 variants
StartBold,
EndBold,
StartCode,
EndCode,
StartHighlight,
EndHighlight,
StartItalics,
EndItalics,
StartLink {
url: String,
},
EndLink,
Mention(Mention),
Timestamp {
timestamp: OffsetDateTime,
},
StartStrikethrough,
EndStrikethrough,
StartUnderline,
EndUnderline,
Label(Label),
}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
StartLink
EndLink
Mention(Mention)
Timestamp
Fields
§
timestamp: OffsetDateTimeStartStrikethrough
EndStrikethrough
StartUnderline
EndUnderline
Label(Label)
Implementations§
source§impl Annotation
impl Annotation
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<Annotation> for Annotation
impl PartialEq<Annotation> 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 ==.