pub struct ProtocolSerializer {}
Implementations§
Source§impl ProtocolSerializer
impl ProtocolSerializer
pub fn new() -> ProtocolSerializer
pub fn is_valid_size(&self, size: u32) -> bool
pub fn serialize_header( &self, id: u32, next: u32, data_len: usize, ) -> Option<Bytes>
pub fn serialize_message_simple(&self, msg: &Message) -> Option<Bytes>
pub fn serialize_message_typed<S: Serialize>( &self, msg: &Message, obj: &S, ) -> Option<Bytes>
pub fn serialize_body<S: Serialize>(&self, obj: &S) -> Option<Bytes>
pub fn serialize_response_simple(&self, resp: &Response) -> Option<Bytes>
pub fn serialize_response_typed<S: Serialize>( &self, msg: &Response, obj: &S, ) -> Option<Bytes>
pub fn deserialize_data( &self, config: &Config, header: &[u8], body: Bytes, ) -> Result<Data, Error>
pub fn deserialize_message_typed<'a, D: Deserialize<'a>>( &self, msg: &'a Message, ) -> Result<Option<D>, Error>
pub fn deserialize_response_typed<D1: DeserializeOwned, D2: DeserializeOwned>( &self, resp: &Response, ) -> Result<Option<ResponseValue<D1, D2>>, Error>
Trait Implementations§
Source§impl Default for ProtocolSerializer
impl Default for ProtocolSerializer
Source§fn default() -> ProtocolSerializer
fn default() -> ProtocolSerializer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProtocolSerializer
impl RefUnwindSafe for ProtocolSerializer
impl Send for ProtocolSerializer
impl Sync for ProtocolSerializer
impl Unpin for ProtocolSerializer
impl UnwindSafe for ProtocolSerializer
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