[][src]Struct rkyv::ArchiveWriter

pub struct ArchiveWriter<W: Write> { /* fields omitted */ }

Wraps a type that implements io::Write and equips it with Write.

Examples

use rkyv::{ArchiveWriter, Write};

let mut writer = ArchiveWriter::new(Vec::new());
assert_eq!(writer.pos(), 0);
writer.write(&[0u8, 1u8, 2u8, 3u8]);
assert_eq!(writer.pos(), 4);
let buf = writer.into_inner();
assert_eq!(buf.len(), 4);
assert_eq!(buf, vec![0u8, 1u8, 2u8, 3u8]);

Implementations

impl<W: Write> ArchiveWriter<W>[src]

pub fn new(inner: W) -> Self[src]

Creates a new archive writer from a writer.

pub fn with_pos(inner: W, pos: usize) -> Self[src]

Creates a new archive writer from a writer, and assumes that the underlying writer is currently at the given position.

pub fn into_inner(self) -> W[src]

Consumes the writer and returns the internal writer used to create it.

Trait Implementations

impl<W: Write> Write for ArchiveWriter<W>[src]

type Error = Error

The errors that may occur while writing.

Auto Trait Implementations

impl<W> RefUnwindSafe for ArchiveWriter<W> where
    W: RefUnwindSafe

impl<W> Send for ArchiveWriter<W> where
    W: Send

impl<W> Sync for ArchiveWriter<W> where
    W: Sync

impl<W> Unpin for ArchiveWriter<W> where
    W: Unpin

impl<W> UnwindSafe for ArchiveWriter<W> where
    W: UnwindSafe

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.

impl<W> WriteExt for W where
    W: Write + ?Sized
[src]