Struct spacetimedb_sats::algebraic_value::ser::ValueSerializer
source · pub struct ValueSerializer;
Expand description
An implementation of Serializer
where the output of serialization is an AlgebraicValue
.
Trait Implementations§
source§impl Serializer for ValueSerializer
impl Serializer for ValueSerializer
§type Ok = AlgebraicValue
type Ok = AlgebraicValue
The output type produced by this
Serializer
during successful serialization. Read more§type Error = Infallible
type Error = Infallible
The error type when some error occurs during serialization.
§type SerializeArray = SerializeArrayValue
type SerializeArray = SerializeArrayValue
Type returned from
serialize_array
for serializing the contents of the array.§type SerializeMap = SerializeMapValue
type SerializeMap = SerializeMapValue
Type returned from
serialize_map
for serializing the contents of the map.§type SerializeSeqProduct = SerializeProductValue
type SerializeSeqProduct = SerializeProductValue
Type returned from
serialize_seq_product
for serializing the contents of the unnamed product.§type SerializeNamedProduct = ForwardNamedToSeqProduct<SerializeProductValue>
type SerializeNamedProduct = ForwardNamedToSeqProduct<SerializeProductValue>
Type returned from
serialize_named_product
for serializing the contents of the named product.source§fn serialize_str(self, v: &str) -> Result<Self::Ok, Self::Error>
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>
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>
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 moresource§fn serialize_map(self, len: usize) -> Result<Self::SerializeMap, Self::Error>
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 moresource§fn serialize_seq_product(
self,
len: usize
) -> Result<Self::SerializeSeqProduct, Self::Error>
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 moresource§fn serialize_named_product(
self,
len: usize
) -> Result<Self::SerializeNamedProduct, Self::Error>
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 moresource§fn serialize_variant<T: Serialize + ?Sized>(
self,
tag: u8,
_name: Option<&str>,
value: &T
) -> Result<Self::Ok, Self::Error>
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>
unsafe fn serialize_bsatn( self, ty: &AlgebraicType, bsatn: &[u8] ) -> Result<Self::Ok, Self::Error>
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>
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>
Auto Trait Implementations§
impl RefUnwindSafe for ValueSerializer
impl Send for ValueSerializer
impl Sync for ValueSerializer
impl Unpin for ValueSerializer
impl UnwindSafe for ValueSerializer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more