#[non_exhaustive]pub enum CaptionKind {
Example,
Figure,
Listing,
Table,
}Expand description
A block category with its own caption attribute and counter.
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.
Example
An example block or paragraph controlled by example-caption.
Figure
A block image controlled by figure-caption.
Listing
A listing or source block controlled by listing-caption.
Table
A table controlled by table-caption.
Implementations§
Source§impl CaptionKind
impl CaptionKind
Sourcepub fn for_style(style: Option<&str>) -> Option<Self>
pub fn for_style(style: Option<&str>) -> Option<Self>
The caption category a [style] names on a paragraph, or on a delimiter that carries
no context of its own.
Parsed blocks already carry their caption in BlockMetadata::caption; this is for a
consumer classifying a block it built itself.
Sourcepub fn for_delimited(
inner: &DelimitedBlockType<'_>,
style: Option<&str>,
) -> Option<Self>
pub fn for_delimited( inner: &DelimitedBlockType<'_>, style: Option<&str>, ) -> Option<Self>
The caption category of a delimited block, from its delimiter and style.
Parsed blocks already carry their caption in BlockMetadata::caption; this is for a
consumer classifying a block it built itself.
Trait Implementations§
Source§impl Clone for CaptionKind
impl Clone for CaptionKind
impl Copy for CaptionKind
Source§impl Debug for CaptionKind
impl Debug for CaptionKind
impl Eq for CaptionKind
Source§impl PartialEq for CaptionKind
impl PartialEq for CaptionKind
impl StructuralPartialEq for CaptionKind
Auto Trait Implementations§
impl Freeze for CaptionKind
impl RefUnwindSafe for CaptionKind
impl Send for CaptionKind
impl Sync for CaptionKind
impl Unpin for CaptionKind
impl UnsafeUnpin for CaptionKind
impl UnwindSafe for CaptionKind
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