Struct tbot::markup::CodeBlock[][src]

#[must_use = "formatters need to be formatted with `markdown_v2` or `html`"]
pub struct CodeBlock<C> { /* fields omitted */ }

Formats a block of code. Can be created with code_block.


impl<C> CodeBlock<C>[src]

pub fn language(self, language: impl Into<String>) -> Self[src]

Defines the langauge of the code block.


Panics if the language contains a line break or a quote.

Trait Implementations

impl<C: Clone> Clone for CodeBlock<C>[src]

impl<C: Debug> Debug for CodeBlock<C>[src]

impl<C> Formattable for CodeBlock<C> where
    C: Deref<Target = str>, 

impl<C> Formattable for CodeBlock<C> where
    C: Deref<Target = str>, 

impl<C: Hash> Hash for CodeBlock<C>[src]

impl<C: PartialEq> PartialEq<CodeBlock<C>> for CodeBlock<C>[src]

impl<C: Eq> Eq for CodeBlock<C>[src]

impl<C> StructuralEq for CodeBlock<C>[src]

impl<C> StructuralPartialEq for CodeBlock<C>[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for CodeBlock<C> where
    C: RefUnwindSafe

impl<C> Send for CodeBlock<C> where
    C: Send

impl<C> Sync for CodeBlock<C> where
    C: Sync

impl<C> Unpin for CodeBlock<C> where
    C: Unpin

impl<C> UnwindSafe for CodeBlock<C> where
    C: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Formattable for T where
    T: Formattable + Formattable