#[non_exhaustive]pub struct CodeData {
pub open: Option<String>,
pub close: Option<String>,
pub standalone: Option<String>,
pub label: Option<String>,
}Expand description
The original markup of one inline code, kept so the writer can reproduce it.
A paired code fills open and close; a standalone code fills standalone. Build it with
CodeData::paired, CodeData::standalone or CodeData::new and the with_* methods.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.open: Option<String>The opening markup of a paired code.
close: Option<String>The closing markup of a paired code.
standalone: Option<String>The markup of a standalone code.
label: Option<String>Human label for the tag chip, e.g. “bold”, “link”.
Implementations§
Source§impl CodeData
impl CodeData
Sourcepub fn paired(open: impl Into<String>, close: impl Into<String>) -> CodeData
pub fn paired(open: impl Into<String>, close: impl Into<String>) -> CodeData
A paired code’s markup.
Sourcepub fn standalone(markup: impl Into<String>) -> CodeData
pub fn standalone(markup: impl Into<String>) -> CodeData
A standalone code’s markup.
Sourcepub fn with_open(self, open: impl IntoOptionString) -> CodeData
pub fn with_open(self, open: impl IntoOptionString) -> CodeData
Sets (or with None clears) the opening markup.
Sourcepub fn with_close(self, close: impl IntoOptionString) -> CodeData
pub fn with_close(self, close: impl IntoOptionString) -> CodeData
Sets (or clears) the closing markup.
Sourcepub fn with_standalone(self, standalone: impl IntoOptionString) -> CodeData
pub fn with_standalone(self, standalone: impl IntoOptionString) -> CodeData
Sets (or clears) the standalone markup.
Sourcepub fn with_label(self, label: impl IntoOptionString) -> CodeData
pub fn with_label(self, label: impl IntoOptionString) -> CodeData
Sets (or clears) the chip label.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CodeData
impl<'de> Deserialize<'de> for CodeData
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
impl Eq for CodeData
impl StructuralPartialEq for CodeData
Auto Trait Implementations§
impl Forget for CodeData
impl Freeze for CodeData
impl RefUnwindSafe for CodeData
impl Send for CodeData
impl Sync for CodeData
impl Unpin for CodeData
impl UnsafeUnpin for CodeData
impl UnwindSafe for CodeData
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