[−][src]Struct nobility::bin_encode::NbtWriter
This object owns the buffer that the NBT is being written into. It represents one document.
Example
use nobility::bin_encode::NbtWriter; let mut writer = NbtWriter::new(); let mut root = writer.root("hello world"); // ... fill in contents ... // finish() call is required. root.finish(); let result: Vec<u8> = writer.finish();
Implementations
impl NbtWriter
[src]
pub fn new() -> NbtWriter
[src]
Creates a new empty writer.
pub fn root<'a>(&'a mut self, name: &str) -> CompoundWriter<'a>
[src]
Creates the root tag with the given name and returns a builder for it.
pub fn finish(self) -> Vec<u8>
[src]
Finalizes the NBT document and returns the buffer for use.
Panics
This method panics if root() was never called, as this would result in an invalid document.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for NbtWriter
[src]
impl Send for NbtWriter
[src]
impl Sync for NbtWriter
[src]
impl Unpin for NbtWriter
[src]
impl UnwindSafe for NbtWriter
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,