pub struct CdrSerializer<W, BO>where
W: Write,{ /* private fields */ }Expand description
a CDR serializer implementation
Parameter W is an io::Write that would receive the serialization.
Parameter BO is byte order: LittleEndian or
BigEndian
Implementations§
Source§impl<W, BO> CdrSerializer<W, BO>
impl<W, BO> CdrSerializer<W, BO>
pub fn new(w: W) -> CdrSerializer<W, BO>
Trait Implementations§
Source§impl<'a, W, BO> SerializeMap for &'a mut CdrSerializer<W, BO>
impl<'a, W, BO> SerializeMap for &'a mut CdrSerializer<W, BO>
Source§impl<'a, W, BO> SerializeSeq for &'a mut CdrSerializer<W, BO>
impl<'a, W, BO> SerializeSeq for &'a mut CdrSerializer<W, BO>
Source§impl<'a, W, BO> SerializeStruct for &'a mut CdrSerializer<W, BO>
impl<'a, W, BO> SerializeStruct for &'a mut CdrSerializer<W, BO>
Source§impl<'a, W, BO> SerializeStructVariant for &'a mut CdrSerializer<W, BO>
impl<'a, W, BO> SerializeStructVariant for &'a mut CdrSerializer<W, BO>
Source§impl<'a, W, BO> SerializeTuple for &'a mut CdrSerializer<W, BO>
impl<'a, W, BO> SerializeTuple for &'a mut CdrSerializer<W, BO>
Source§impl<'a, W, BO> SerializeTupleStruct for &'a mut CdrSerializer<W, BO>
impl<'a, W, BO> SerializeTupleStruct for &'a mut CdrSerializer<W, BO>
Source§impl<'a, W, BO> SerializeTupleVariant for &'a mut CdrSerializer<W, BO>
impl<'a, W, BO> SerializeTupleVariant for &'a mut CdrSerializer<W, BO>
Source§impl<'a, W, BO> Serializer for &'a mut CdrSerializer<W, BO>
impl<'a, W, BO> Serializer for &'a mut CdrSerializer<W, BO>
Source§type Ok = ()
type Ok = ()
The output type produced by this
Serializer during successful
serialization. Most serializers that produce text or binary output
should set Ok = () and serialize into an io::Write or buffer
contained within the Serializer instance. Serializers that build
in-memory data structures may be simplified by using Ok to propagate
the data structure around.Source§type SerializeSeq = &'a mut CdrSerializer<W, BO>
type SerializeSeq = &'a mut CdrSerializer<W, BO>
Type returned from
serialize_seq for serializing the content of the
sequence.Source§type SerializeTuple = &'a mut CdrSerializer<W, BO>
type SerializeTuple = &'a mut CdrSerializer<W, BO>
Type returned from
serialize_tuple for serializing the content of
the tuple.Source§type SerializeTupleStruct = &'a mut CdrSerializer<W, BO>
type SerializeTupleStruct = &'a mut CdrSerializer<W, BO>
Type returned from
serialize_tuple_struct for serializing the
content of the tuple struct.Source§type SerializeTupleVariant = &'a mut CdrSerializer<W, BO>
type SerializeTupleVariant = &'a mut CdrSerializer<W, BO>
Type returned from
serialize_tuple_variant for serializing the
content of the tuple variant.Source§type SerializeMap = &'a mut CdrSerializer<W, BO>
type SerializeMap = &'a mut CdrSerializer<W, BO>
Type returned from
serialize_map for serializing the content of the
map.Source§type SerializeStruct = &'a mut CdrSerializer<W, BO>
type SerializeStruct = &'a mut CdrSerializer<W, BO>
Type returned from
serialize_struct for serializing the content of
the struct.Source§type SerializeStructVariant = &'a mut CdrSerializer<W, BO>
type SerializeStructVariant = &'a mut CdrSerializer<W, BO>
Type returned from
serialize_struct_variant for serializing the
content of the struct variant.Source§fn serialize_bytes(self, v: &[u8]) -> Result<(), Error>
fn serialize_bytes(self, v: &[u8]) -> Result<(), Error>
Serialize a chunk of raw byte data. Read more
Source§fn serialize_unit_variant(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
) -> Result<(), Error>
fn serialize_unit_variant( self, _name: &'static str, variant_index: u32, _variant: &'static str, ) -> Result<(), Error>
Source§fn serialize_newtype_struct<T>(
self,
_name: &'static str,
value: &T,
) -> Result<(), Error>
fn serialize_newtype_struct<T>( self, _name: &'static str, value: &T, ) -> Result<(), Error>
Serialize a newtype struct like
struct Millimeters(u8). Read moreSource§fn serialize_newtype_variant<T>(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
value: &T,
) -> Result<(), Error>
fn serialize_newtype_variant<T>( self, _name: &'static str, variant_index: u32, _variant: &'static str, value: &T, ) -> Result<(), Error>
Source§fn serialize_seq(
self,
len: Option<usize>,
) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeSeq, Error>
fn serialize_seq( self, len: Option<usize>, ) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeSeq, Error>
Begin to serialize a variably sized sequence. This call must be
followed by zero or more calls to
serialize_element, then a call to
end. Read moreSource§fn serialize_tuple(
self,
_len: usize,
) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeTuple, Error>
fn serialize_tuple( self, _len: usize, ) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeTuple, Error>
Begin to serialize a statically sized sequence whose length will be
known at deserialization time without looking at the serialized data.
This call must be followed by zero or more calls to
serialize_element,
then a call to end. Read moreSource§fn serialize_tuple_struct(
self,
_name: &'static str,
_len: usize,
) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeTupleStruct, Error>
fn serialize_tuple_struct( self, _name: &'static str, _len: usize, ) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeTupleStruct, Error>
Begin to serialize a tuple struct like
struct Rgb(u8, u8, u8). This
call must be followed by zero or more calls to serialize_field, then a
call to end. Read moreSource§fn serialize_tuple_variant(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
_len: usize,
) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeTupleVariant, Error>
fn serialize_tuple_variant( self, _name: &'static str, variant_index: u32, _variant: &'static str, _len: usize, ) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeTupleVariant, Error>
Begin to serialize a tuple variant like
E::T in enum E { T(u8, u8) }. This call must be followed by zero or more calls to
serialize_field, then a call to end. Read moreSource§fn serialize_map(
self,
len: Option<usize>,
) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeMap, Error>
fn serialize_map( self, len: Option<usize>, ) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeMap, Error>
Begin to serialize a map. This call must be followed by zero or more
calls to
serialize_key and serialize_value, then a call to end. Read moreSource§fn serialize_struct(
self,
_name: &'static str,
_len: usize,
) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeStruct, Error>
fn serialize_struct( self, _name: &'static str, _len: usize, ) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeStruct, Error>
Begin to serialize a struct like
struct Rgb { r: u8, g: u8, b: u8 }.
This call must be followed by zero or more calls to serialize_field,
then a call to end. Read moreSource§fn serialize_struct_variant(
self,
_name: &'static str,
variant_index: u32,
_variant: &'static str,
_len: usize,
) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeStructVariant, Error>
fn serialize_struct_variant( self, _name: &'static str, variant_index: u32, _variant: &'static str, _len: usize, ) -> Result<<&'a mut CdrSerializer<W, BO> as Serializer>::SerializeStructVariant, Error>
Begin to serialize a struct variant like
E::S in enum E { S { r: u8, g: u8, b: u8 } }. This call must be followed by zero or more calls to
serialize_field, then a call to end. Read moreSource§fn is_human_readable(&self) -> bool
fn is_human_readable(&self) -> bool
Determine whether
Serialize implementations should serialize in
human-readable form. Read moreSource§fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error>
fn serialize_i128(self, v: i128) -> Result<Self::Ok, Self::Error>
Serialize an
i128 value. Read moreSource§fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error>
fn collect_seq<I>(self, iter: I) -> Result<Self::Ok, Self::Error>
Collect an iterator as a sequence. Read more
Auto Trait Implementations§
impl<W, BO> Freeze for CdrSerializer<W, BO>where
W: Freeze,
impl<W, BO> RefUnwindSafe for CdrSerializer<W, BO>where
W: RefUnwindSafe,
BO: RefUnwindSafe,
impl<W, BO> Send for CdrSerializer<W, BO>
impl<W, BO> Sync for CdrSerializer<W, BO>
impl<W, BO> Unpin for CdrSerializer<W, BO>
impl<W, BO> UnwindSafe for CdrSerializer<W, BO>where
W: UnwindSafe,
BO: UnwindSafe,
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