pub trait CodeBlock {
// Required methods
fn to_code_block(&self) -> String;
fn to_code_block_with_language<S: AsRef<str>>(&self, language: S) -> String;
}
Expand description
An extension trait for code block transformations.
Required Methods§
Sourcefn to_code_block(&self) -> String
fn to_code_block(&self) -> String
Transforms the given text into a code block.
Sourcefn to_code_block_with_language<S: AsRef<str>>(&self, language: S) -> String
fn to_code_block_with_language<S: AsRef<str>>(&self, language: S) -> String
Transforms the given text into a code block, allowing to specify the language to use for highlighting.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.