pub struct CodeConfig {
pub info: Option<Str>,
pub language: Language,
pub content: Str,
pub on_copied: Option<OnCopied>,
}Expand description
Everything a fenced code block is, before anything decides how to show it.
An application claims a fence by installing a Hook<CodeConfig> on its
environment; a hook that does not recognise info calls
ViewConfiguration::render to get the ordinary code block back.
Fields§
§info: Option<Str>The fence’s info token as written (mermaid, rust, …), if it had one.
language: LanguageThe language that token resolved to; Language::Plaintext when it
resolved to nothing.
content: StrThe block’s text, verbatim.
on_copied: Option<OnCopied>The caller’s feedback for a copy, if it asked for any. Carried so a hook that declines the fence and renders the default keeps it.
Trait Implementations§
Source§impl Clone for CodeConfig
impl Clone for CodeConfig
Source§impl Debug for CodeConfig
impl Debug for CodeConfig
Auto Trait Implementations§
impl !RefUnwindSafe for CodeConfig
impl !Send for CodeConfig
impl !Sync for CodeConfig
impl !UnwindSafe for CodeConfig
impl Freeze for CodeConfig
impl Unpin for CodeConfig
impl UnsafeUnpin for CodeConfig
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