[−][src]Struct rkyv::ArchiveWriter
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]
Auto Trait Implementations
impl<W> RefUnwindSafe for ArchiveWriter<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for ArchiveWriter<W> where
W: Send,
W: Send,
impl<W> Sync for ArchiveWriter<W> where
W: Sync,
W: Sync,
impl<W> Unpin for ArchiveWriter<W> where
W: Unpin,
W: Unpin,
impl<W> UnwindSafe for ArchiveWriter<W> where
W: UnwindSafe,
W: UnwindSafe,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<W> WriteExt for W where
W: Write + ?Sized,
[src]
W: Write + ?Sized,
pub fn align(&mut self, align: usize) -> Result<usize, Self::Error>
[src]
pub fn align_for<T>(&mut self) -> Result<usize, Self::Error>
[src]
pub unsafe fn resolve_aligned<T: ?Sized, R: Resolve<T>>(
&mut self,
value: &T,
resolver: R
) -> Result<usize, Self::Error>
[src]
&mut self,
value: &T,
resolver: R
) -> Result<usize, Self::Error>
pub fn archive<T: Archive>(&mut self, value: &T) -> Result<usize, Self::Error>
[src]
pub fn archive_ref<T: ArchiveRef + ?Sized>(
&mut self,
value: &T
) -> Result<usize, Self::Error>
[src]
&mut self,
value: &T
) -> Result<usize, Self::Error>