[][src]Trait rkyv::WriteExt

pub trait WriteExt: Write {
    fn align(&mut self, align: usize) -> Result<usize, Self::Error> { ... }
fn align_for<T>(&mut self) -> Result<usize, Self::Error> { ... }
unsafe fn resolve_aligned<T: ?Sized, R: Resolve<T>>(
        &mut self,
        value: &T,
        resolver: R
    ) -> Result<usize, Self::Error> { ... }
fn archive<T: Archive>(&mut self, value: &T) -> Result<usize, Self::Error> { ... }
fn archive_ref<T: ArchiveRef + ?Sized>(
        &mut self,
        value: &T
    ) -> Result<usize, Self::Error> { ... } }

Helper functions on Write objects.

Provided methods

fn align(&mut self, align: usize) -> Result<usize, Self::Error>

Aligns the position of the writer to the given alignment.

fn align_for<T>(&mut self) -> Result<usize, Self::Error>

Aligns the position of the writer to be suitable to write the given type.

unsafe fn resolve_aligned<T: ?Sized, R: Resolve<T>>(
    &mut self,
    value: &T,
    resolver: R
) -> Result<usize, Self::Error>

Resolves the given resolver and writes its archived type, returning the position of the written archived type.

Safety

This is only safe to call when the writer is already aligned for the archived version of the given type.

fn archive<T: Archive>(&mut self, value: &T) -> Result<usize, Self::Error>

Archives the given object and returns the position it was archived at.

fn archive_ref<T: ArchiveRef + ?Sized>(
    &mut self,
    value: &T
) -> Result<usize, Self::Error>

Archives a reference to the given object and returns the position it was archived at.

Loading content...

Implementors

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

Loading content...