Struct spacetimedb_sats::bsatn::ser::Serializer
source · pub struct Serializer<'a, W> { /* private fields */ }
Expand description
Defines the BSATN serialization data format.
Implementations§
Trait Implementations§
source§impl<W: BufWriter> SerializeArray for Serializer<'_, W>
impl<W: BufWriter> SerializeArray for Serializer<'_, W>
source§impl<W: BufWriter> SerializeMap for Serializer<'_, W>
impl<W: BufWriter> SerializeMap for Serializer<'_, W>
source§impl<W: BufWriter> SerializeSeqProduct for Serializer<'_, W>
impl<W: BufWriter> SerializeSeqProduct for Serializer<'_, W>
source§impl<W: BufWriter> Serializer for Serializer<'_, W>
impl<W: BufWriter> Serializer for Serializer<'_, W>
§type Error = BsatnError
type Error = BsatnError
The error type when some error occurs during serialization.
§type SerializeArray = Serializer<'_, W>
type SerializeArray = Serializer<'_, W>
Type returned from
serialize_array
for serializing the contents of the array.§type SerializeMap = Serializer<'_, W>
type SerializeMap = Serializer<'_, W>
Type returned from
serialize_map
for serializing the contents of the map.§type SerializeSeqProduct = Serializer<'_, W>
type SerializeSeqProduct = Serializer<'_, W>
Type returned from
serialize_seq_product
for serializing the contents of the unnamed product.§type SerializeNamedProduct = ForwardNamedToSeqProduct<Serializer<'_, W>>
type SerializeNamedProduct = ForwardNamedToSeqProduct<Serializer<'_, W>>
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>
Auto Trait Implementations§
impl<'a, W> RefUnwindSafe for Serializer<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for Serializer<'a, W>where
W: Send,
impl<'a, W> Sync for Serializer<'a, W>where
W: Sync,
impl<'a, W> Unpin for Serializer<'a, W>
impl<'a, W> !UnwindSafe for Serializer<'a, W>
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