Skip to main content

SerializationContext

Struct SerializationContext 

Source
pub struct SerializationContext<Output>
where Output: BinaryOutput,
{ /* private fields */ }

Implementations§

Source§

impl<Output> SerializationContext<Output>
where Output: BinaryOutput,

Source

pub fn new(output: Output, options: Options) -> SerializationContext<Output>

Source

pub fn into_output(self) -> Output

Source

pub fn state_mut(&mut self) -> &mut State

Source

pub fn store_ref_or_object(&mut self, value: &impl Any) -> Result<bool, Error>

Source

pub fn options(&self) -> &Options

Source

pub fn push_buffer(&mut self, buffer: Vec<u8>)

Source

pub fn pop_buffer(&mut self) -> Vec<u8>

Trait Implementations§

Source§

impl<Output> BinaryOutput for SerializationContext<Output>
where Output: BinaryOutput,

Source§

fn write_u8(&mut self, value: u8)

Source§

fn write_bytes(&mut self, bytes: &[u8])

Source§

fn write_i8(&mut self, value: i8)

Source§

fn write_u16(&mut self, value: u16)

Source§

fn write_i16(&mut self, value: i16)

Source§

fn write_u32(&mut self, value: u32)

Source§

fn write_i32(&mut self, value: i32)

Source§

fn write_u64(&mut self, value: u64)

Source§

fn write_i64(&mut self, value: i64)

Source§

fn write_u128(&mut self, value: u128)

Source§

fn write_i128(&mut self, value: i128)

Source§

fn write_f32(&mut self, value: f32)

Source§

fn write_f64(&mut self, value: f64)

Source§

fn write_var_u32(&mut self, value: u32)

Source§

fn write_var_i32(&mut self, value: i32)

Source§

fn write_compressed( &mut self, bytes: &[u8], opts: Compression, ) -> Result<(), Error>

Auto Trait Implementations§

§

impl<Output> !Freeze for SerializationContext<Output>

§

impl<Output> !RefUnwindSafe for SerializationContext<Output>

§

impl<Output> !Send for SerializationContext<Output>

§

impl<Output> !Sync for SerializationContext<Output>

§

impl<Output> Unpin for SerializationContext<Output>
where Output: Unpin,

§

impl<Output> UnsafeUnpin for SerializationContext<Output>
where Output: UnsafeUnpin,

§

impl<Output> !UnwindSafe for SerializationContext<Output>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.