[][src]Struct binjs::io::simple::TreeTokenWriter

pub struct TreeTokenWriter { /* fields omitted */ }

A trivial tree writer, without any kind of optimization.

Methods

impl TreeTokenWriter[src]

pub fn new() -> TreeTokenWriter[src]

pub fn data(&self) -> Option<&[u8]>[src]

Trait Implementations

impl TokenWriterWithTree for TreeTokenWriter[src]

type Tree = AbstractTree

type Data = Box<[u8]>

The type of data generated by this writer. Typically some variant of Vec<u8>. Read more

fn list(
    &mut self,
    items: Vec<<TreeTokenWriter as TokenWriterWithTree>::Tree>
) -> Result<<TreeTokenWriter as TokenWriterWithTree>::Tree, TokenWriterError>
[src]

Lists are represented as:

  • ""
  • number of items (u32);
  • items
  • ""

The number of bytes is the total size of

  • number of items;
  • items.

fn tagged_tuple(
    &mut self,
    tag: &InterfaceName,
    children: &[(&FieldName, <TreeTokenWriter as TokenWriterWithTree>::Tree)]
) -> Result<<TreeTokenWriter as TokenWriterWithTree>::Tree, TokenWriterError>
[src]

For this example, we use a very, very, very suboptimal encoding.

  • - kind (string, \0 terminated) - number of items (varnum) - field names (string, \0 terminated)
  • contents

Auto Trait Implementations

impl !RefUnwindSafe for TreeTokenWriter

impl !Send for TreeTokenWriter

impl !Sync for TreeTokenWriter

impl Unpin for TreeTokenWriter

impl UnwindSafe for TreeTokenWriter

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> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]