[][src]Struct sidoc::Builder

pub struct Builder { /* fields omitted */ }

Constructor for Doc objects.

Implementations

impl Builder[src]

pub fn new() -> Self[src]

Create a new Doc builder context.

pub fn scope<L: ToString, K: ToString>(
    &mut self,
    begin_line: L,
    term_line: Option<K>
) -> &mut Self
[src]

Begin a scope, pushing an optional scope terminator to the internal scope stack.

If the scope generated using a terminator line, that line will appended to the document when the scope is closed using the exit() method.

pub fn exit(&mut self) -> &mut Self[src]

Leave a previously entered scope.

If the scope() call that created the current scope

pub fn exit_line<L: ToString>(&mut self, line: L) -> &mut Self[src]

Leave previously entered scope, adding a line passed by the caller rather than the scope stack.

pub fn line<L: ToString>(&mut self, line: L) -> &mut Self[src]

Add a new line at current scope.

pub fn optref<N: ToString>(&mut self, name: N) -> &mut Self[src]

Add a named optional reference.

References are placeholders for other documents. An optional reference means that this reference does not need to be resolved by the renderer.

pub fn reqref<N: ToString>(&mut self, name: N) -> &mut Self[src]

Add a named required reference.

References are placeholders for other documents. A required reference must be resolved by the renderer or it will return an error to its caller.

pub fn build(self) -> Result<Doc, Error>[src]

Generate a Doc object from this document.

The document must be properly nested before calling this function, meaning all scopes it opened must be closed.

Auto Trait Implementations

impl RefUnwindSafe for Builder

impl Send for Builder

impl Sync for Builder

impl Unpin for Builder

impl UnwindSafe for Builder

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, U> Into<U> for T where
    U: From<T>, 
[src]

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.