pub struct ValueSerializer;
Expand description

An implementation of Serializer where the output of serialization is an AlgebraicValue.

Trait Implementations§

source§

impl Serializer for ValueSerializer

§

type Ok = AlgebraicValue

The output type produced by this Serializer during successful serialization. Read more
§

type Error = Infallible

The error type when some error occurs during serialization.
§

type SerializeArray = SerializeArrayValue

Type returned from serialize_array for serializing the contents of the array.
§

type SerializeMap = SerializeMapValue

Type returned from serialize_map for serializing the contents of the map.
§

type SerializeSeqProduct = SerializeProductValue

Type returned from serialize_seq_product for serializing the contents of the unnamed product.
§

type SerializeNamedProduct = ForwardNamedToSeqProduct<SerializeProductValue>

Type returned from serialize_named_product for serializing the contents of the named product.
source§

fn serialize_bool(self, v: bool) -> Result<Self::Ok, Self::Error>

Serialize a bool value.
source§

fn serialize_u8(self, v: u8) -> Result<Self::Ok, Self::Error>

Serialize a u8 value.
source§

fn serialize_u16(self, v: u16) -> Result<Self::Ok, Self::Error>

Serialize a u16 value.
source§

fn serialize_u32(self, v: u32) -> Result<Self::Ok, Self::Error>

Serialize a u32 value.
source§

fn serialize_u64(self, v: u64) -> Result<Self::Ok, Self::Error>

Serialize a u64 value.
source§

fn serialize_u128(self, v: u128) -> Result<Self::Ok, Self::Error>

Serialize a u128 value.
source§

fn serialize_i8(self, v: i8) -> Result<Self::Ok, Self::Error>

Serialize an i8 value.
source§

fn serialize_i16(self, v: i16) -> Result<Self::Ok, Self::Error>

Serialize an i16 value.
source§

fn serialize_i32(self, v: i32) -> Result<Self::Ok, Self::Error>

Serialize an i32 value.
source§

fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error>

Serialize an i64 value.
source§

fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error>

Serialize an i128 value.
source§

fn serialize_f32(self, v: f32) -> Result<Self::Ok, Self::Error>

Serialize an f32 value.
source§

fn serialize_f64(self, v: f64) -> Result<Self::Ok, Self::Error>

Serialize an f64 value.
source§

fn serialize_str(self, v: &str) -> Result<Self::Ok, Self::Error>

Serialize a &str string slice.
source§

fn serialize_bytes(self, v: &[u8]) -> Result<Self::Ok, Self::Error>

Serialize a &[u8] byte slice.
source§

fn serialize_array( self, len: usize ) -> Result<Self::SerializeArray, Self::Error>

Begin to serialize a variably sized array. This call must be followed by zero or more calls to SerializeArray::serialize_element, then a call to SerializeArray::end. Read more
source§

fn serialize_map(self, len: usize) -> Result<Self::SerializeMap, Self::Error>

Begin to serialize a variably sized map. This call must be followed by zero or more calls to [SerializeMap::serialize_element], then a call to SerializeMap::end. Read more
source§

fn serialize_seq_product( self, len: usize ) -> Result<Self::SerializeSeqProduct, Self::Error>

Begin to serialize a product with unnamed fields. This call must be followed by zero or more calls to SerializeSeqProduct::serialize_element, then a call to SerializeSeqProduct::end. Read more
source§

fn serialize_named_product( self, len: usize ) -> Result<Self::SerializeNamedProduct, Self::Error>

Begin to serialize a product with named fields. This call must be followed by zero or more calls to SerializeNamedProduct::serialize_element, then a call to SerializeNamedProduct::end. Read more
source§

fn serialize_variant<T: Serialize + ?Sized>( self, tag: u8, _name: Option<&str>, value: &T ) -> Result<Self::Ok, Self::Error>

Serialize a sum value provided the chosen tag, name, and value.
source§

unsafe fn serialize_bsatn( self, ty: &AlgebraicType, bsatn: &[u8] ) -> Result<Self::Ok, Self::Error>

Serialize the given bsatn encoded data of type ty. Read more
source§

unsafe fn serialize_bsatn_in_chunks<'a, I: Iterator<Item = &'a [u8]>>( self, ty: &AlgebraicType, total_bsatn_len: usize, chunks: I ) -> Result<Self::Ok, Self::Error>

Serialize the given bsatn encoded data of type ty. Read more
source§

unsafe fn serialize_str_in_chunks<'a, I: Iterator<Item = &'a [u8]>>( self, total_len: usize, string: I ) -> Result<Self::Ok, Self::Error>

Serialize the given string. Read more

Auto Trait Implementations§

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more