[][src]Enum shoebill::Doc

pub enum Doc<'p> {
    Nil,
    Hardline,
    Newline(Option<DocPtr<'p>>),
    Text(StringPtr<'p>),
    Concat {
        l: DocPtr<'p>,
        r: DocPtr<'p>,
        flat_len: u32,
        has_newline: Option<bool>,
        dist_next_newline: u32,
    },
    Nest {
        amt: u32,
        doc: DocPtr<'p>,
        flat_len: u32,
        has_newline: Option<bool>,
        dist_next_newline: u32,
    },
    Group {
        doc: DocPtr<'p>,
        flat_len: u32,
        has_newline: Option<bool>,
        dist_next_newline: u32,
    },
}

The inner document type. Newline gives you the option of specifying an alternate representation (as an Option) in cases where the renderer is in flat mode, where being in flat mode means you've either elected to specifically render something as flat, or you elected to group elements together (as a Group node), and all of the grouped elements will fit onto the current line without exceeding the line width specified for rendering.

The default behavior of Newline(None) in flatmode is to render a space. Hardline will always render as a linebreak, no matter what.

Variants

Nil
Hardline
Newline(Option<DocPtr<'p>>)
Text(StringPtr<'p>)
Concat

Fields of Concat

l: DocPtr<'p>r: DocPtr<'p>flat_len: u32has_newline: Option<bool>dist_next_newline: u32
Nest

Fields of Nest

amt: u32doc: DocPtr<'p>flat_len: u32has_newline: Option<bool>dist_next_newline: u32
Group

Fields of Group

doc: DocPtr<'p>flat_len: u32has_newline: Option<bool>dist_next_newline: u32

Trait Implementations

impl<'p> Clone for Doc<'p>[src]

impl<'p> Copy for Doc<'p>[src]

impl<'p> Debug for Doc<'p>[src]

impl<'p, P: HasPrinter<'p>> Doclike<'p, P> for Doc<'p>[src]

impl<'p> Eq for Doc<'p>[src]

impl<'p> Hash for Doc<'p>[src]

impl<'p> PartialEq<Doc<'p>> for Doc<'p>[src]

impl<'p> StructuralEq for Doc<'p>[src]

impl<'p> StructuralPartialEq for Doc<'p>[src]

Auto Trait Implementations

impl<'p> RefUnwindSafe for Doc<'p>

impl<'p> Send for Doc<'p>

impl<'p> Sync for Doc<'p>

impl<'p> Unpin for Doc<'p>

impl<'p> UnwindSafe for Doc<'p>

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<'p, A, P> Doclike<'p, P> for A where
    P: HasPrinter<'p>,
    Cow<'p, str>: From<A>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

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

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.