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.

Implementations

impl<C> CodeBlock<C>[src]

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

Defines the langauge of the code block.

Panics

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>, 
[src]

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

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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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
[src]