[][src]Trait sise::Writer

pub trait Writer {
    type Result;
    type Error;
    type AtomOptions;
    type BeginListOptions;
    type EndListOptions;
    type FinishOptions;
    fn write_atom(
        &mut self,
        atom: &str,
        opts: &Self::AtomOptions
    ) -> Result<(), Self::Error>;
fn begin_list(
        &mut self,
        opts: &Self::BeginListOptions
    ) -> Result<(), Self::Error>;
fn end_list(
        &mut self,
        opts: &Self::EndListOptions
    ) -> Result<(), Self::Error>;
fn finish(
        self,
        opts: &Self::FinishOptions
    ) -> Result<Self::Result, Self::Error>; }

A trait to allow writing SISE nodes into a generic destination.

Associated Types

type Result

Type of data returned by the writer.

type Error

The error type that may be produced while writing.

type AtomOptions

Type of options that can be passed to write_atom.

type BeginListOptions

Type of options that can be passed to begin_list.

type EndListOptions

Type of options that can be passed to end_list.

type FinishOptions

Type of options that can be passed to finish.

Loading content...

Required methods

fn write_atom(
    &mut self,
    atom: &str,
    opts: &Self::AtomOptions
) -> Result<(), Self::Error>

Writes an atom.

fn begin_list(
    &mut self,
    opts: &Self::BeginListOptions
) -> Result<(), Self::Error>

Begins a list.

fn end_list(&mut self, opts: &Self::EndListOptions) -> Result<(), Self::Error>

Ends a list.

fn finish(self, opts: &Self::FinishOptions) -> Result<Self::Result, Self::Error>

Consumes the writer and returns the result. It must be called only after the root node has been completely written.

Loading content...

Implementors

impl Writer for TreeWriter[src]

impl<'a> Writer for CompactStringWriter<'a>[src]

impl<'a, 'b> Writer for SpacedStringWriter<'a, 'b>[src]

Loading content...