Struct somedoc::model::block::CodeBlock [−][src]
A block of code, syntax highlighting may be used, especially if language
is specified.
Implementations
impl CodeBlock
[src]
pub fn with_language(code: &str, language: &str) -> Self
[src]
Construct a new code block from the provided string ands language name.
pub fn code(&self) -> &String
[src]
Return the inner code value as a string.
pub fn set_code(&mut self, code: &str) -> &mut Self
[src]
Set the code value for this block.
pub fn language(&self) -> &Option<String>
[src]
Return the inner language name as a string, if present.
pub fn set_language(&mut self, language: &str) -> &mut Self
[src]
Set the language for this code block.
pub fn unset_language(&mut self) -> &mut Self
[src]
Set the language for this code block to None.
Trait Implementations
impl Clone for CodeBlock
[src]
impl Debug for CodeBlock
[src]
impl<'de> Deserialize<'de> for CodeBlock
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<&'_ str> for CodeBlock
[src]
impl From<String> for CodeBlock
[src]
impl HasCaption for CodeBlock
[src]
fn caption(&self) -> &Option<Caption>
[src]
fn set_caption(&mut self, caption: Caption) -> &mut Self
[src]
fn unset_caption(&mut self) -> &mut Self
[src]
fn has_caption(&self) -> bool
[src]
impl HasLabel for CodeBlock
[src]
fn has_label(&self) -> bool
[src]
fn label(&self) -> &Option<Label>
[src]
fn set_label(&mut self, label: Label) -> &mut Self
[src]
fn unset_label(&mut self) -> &mut Self
[src]
impl Into<BlockContent> for CodeBlock
[src]
fn into(self) -> BlockContent
[src]
impl Serialize for CodeBlock
[src]
Auto Trait Implementations
impl RefUnwindSafe for CodeBlock
[src]
impl Send for CodeBlock
[src]
impl Sync for CodeBlock
[src]
impl Unpin for CodeBlock
[src]
impl UnwindSafe for CodeBlock
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,