Trait canadensis_encoding::Deserialize
source · [−]pub trait Deserialize: DataType {
fn deserialize(
cursor: &mut ReadCursor<'_>
) -> Result<Self, DeserializeError>
where
Self: Sized;
fn deserialize_zero_copy(cursor: &mut ReadCursor<'_>) -> Self
where
Self: Sized + AsBytes + FromBytes,
{ ... }
fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>
where
Self: Sized,
{ ... }
}
Expand description
Trait for types that can be deserialized from Cyphal transfers
Required Methods
sourcefn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where
Self: Sized,
fn deserialize(cursor: &mut ReadCursor<'_>) -> Result<Self, DeserializeError>where
Self: Sized,
Deserializes a value and returns it
Provided Methods
sourcefn deserialize_zero_copy(cursor: &mut ReadCursor<'_>) -> Selfwhere
Self: Sized + AsBytes + FromBytes,
fn deserialize_zero_copy(cursor: &mut ReadCursor<'_>) -> Selfwhere
Self: Sized + AsBytes + FromBytes,
sourcefn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where
Self: Sized,
fn deserialize_from_bytes(bytes: &[u8]) -> Result<Self, DeserializeError>where
Self: Sized,
A convenience function that creates a cursor around the provided bytes and calls
deserialize