[][src]Struct nobility::bin_encode::CompoundListWriter

pub struct CompoundListWriter<'a> { /* fields omitted */ }

A builder for a TAG_List of TAG_Compounds.

Example

let mut player = some_compound;
let mut list = player.compound_list_field("Friends");

{
    let mut element = list.element();
    element.field("Name").string("Alice");
    element.field("Level").int(20);
    element.finish();
}

{
    let mut element = list.element();
    element.field("Name").string("Steve");
    element.field("Level").int(17);
    element.finish();
}

// finish() call is required.
list.finish();

Panics

This object will panic on drop if finish() is not called.

Implementations

impl<'a> CompoundListWriter<'a>[src]

pub fn element(&mut self) -> CompoundWriter<'_>[src]

Start a new element in the list, returning a CompoundWriter to build it. finish must be called on the builder before additional elements can be added.

pub fn finish(self)[src]

Must be called before the builder goes out of scope, otherwise an invalid NBT document would be generated.

Trait Implementations

impl<'a> Debug for CompoundListWriter<'a>[src]

impl<'a> Drop for CompoundListWriter<'a>[src]

Auto Trait Implementations

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.