Trait rustdds::dds::traits::serde_adapters::no_key::DeserializerAdapter
source · [−]pub trait DeserializerAdapter<D>where
D: DeserializeOwned,{
fn supported_encodings() -> &'static [RepresentationIdentifier];
fn from_bytes(
input_bytes: &[u8],
encoding: RepresentationIdentifier
) -> Result<D, Error>;
fn from_vec_bytes(
input_vec_bytes: &[Bytes],
encoding: RepresentationIdentifier
) -> Result<D, Error> { ... }
}
Expand description
trait for connecting Serde Deserializer implementation and DataReader together - no_key version.
Required Methods
sourcefn supported_encodings() -> &'static [RepresentationIdentifier]
fn supported_encodings() -> &'static [RepresentationIdentifier]
Which data representations can the DeserializerAdapter read? See RTPS specification Section 10 and Table 10.3
sourcefn from_bytes(
fn from_bytes(
input_bytes: &[u8],
encoding: RepresentationIdentifier
) -> Result<D, Error>
Provided Methods
sourcefn from_vec_bytes(
input_vec_bytes: &[Bytes],
encoding: RepresentationIdentifier
) -> Result<D, Error>
fn from_vec_bytes(
input_vec_bytes: &[Bytes],
encoding: RepresentationIdentifier
) -> Result<D, Error>
This method has a default implementation, but the default will make a copy of all the input data in memory and then call from_bytes() .