[go: up one dir, main page]

Writer

Trait Writer 

Source
pub trait Writer<E = <Self as Fallible>::Error>: Positional {
    // Required method
    fn write(&mut self, bytes: &[u8]) -> Result<(), E>;
}
Expand description

A type that writes bytes to some output.

A type that is Write can be wrapped in an IoWriter to equip it with Writer.

It’s important that the memory for archived objects is properly aligned before attempting to read objects out of it; use an AlignedVec or the Align wrapper as appropriate.

Required Methods§

Source

fn write(&mut self, bytes: &[u8]) -> Result<(), E>

Attempts to write the given bytes to the serializer.

Implementations on Foreign Types§

Source§

impl<E> Writer<E> for Vec<u8>

Available on crate feature alloc only.
Source§

fn write(&mut self, bytes: &[u8]) -> Result<(), E>

Source§

impl<T, E> Writer<E> for &mut T
where T: Writer<E> + ?Sized,

Source§

fn write(&mut self, bytes: &[u8]) -> Result<(), E>

Source§

impl<T, E> Writer<E> for Strategy<T, E>
where T: Writer<E> + ?Sized,

Source§

fn write(&mut self, bytes: &[u8]) -> Result<(), E>

Implementors§

Source§

impl<E, const A: usize> Writer<E> for AlignedVec<A>

Available on crate feature alloc only.
Source§

impl<E: Source> Writer<E> for Buffer<'_>

Source§

impl<W: Write, E: Source> Writer<E> for IoWriter<W>

Available on crate feature std only.
Source§

impl<W: Writer<E>, A, S, E> Writer<E> for Serializer<W, A, S>