pub struct MsgPackParser;
Expand description
The MsgPack parser
Trait Implementations§
Source§impl Clone for MsgPackParser
impl Clone for MsgPackParser
Source§fn clone(&self) -> MsgPackParser
fn clone(&self) -> MsgPackParser
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MsgPackParser
impl Debug for MsgPackParser
Source§impl Default for MsgPackParser
impl Default for MsgPackParser
Source§fn default() -> MsgPackParser
fn default() -> MsgPackParser
Returns the “default value” for a type. Read more
Source§impl Parse for MsgPackParser
impl Parse for MsgPackParser
Source§fn decode_str(self, _: &ParserState, _data: Str) -> Result<Packet, ParseError>
fn decode_str(self, _: &ParserState, _data: Str) -> Result<Packet, ParseError>
Parse a given input string. If the payload needs more adjacent binary packet,
the partial packet will be kept and a
ParseError::NeedsMoreBinaryData
will be returned.Source§fn decode_bin(self, _: &ParserState, bin: Bytes) -> Result<Packet, ParseError>
fn decode_bin(self, _: &ParserState, bin: Bytes) -> Result<Packet, ParseError>
Parse a given input binary. If the payload needs more adjacent binary packet,
the partial packet is still kept and a
ParseError::NeedsMoreBinaryData
will be returned.Source§fn encode_value<T: ?Sized + Serialize>(
self,
data: &T,
event: Option<&str>,
) -> Result<Value, ParserError>
fn encode_value<T: ?Sized + Serialize>( self, data: &T, event: Option<&str>, ) -> Result<Value, ParserError>
Source§fn decode_value<'de, T: Deserialize<'de>>(
self,
value: &'de mut Value,
with_event: bool,
) -> Result<T, ParserError>
fn decode_value<'de, T: Deserialize<'de>>( self, value: &'de mut Value, with_event: bool, ) -> Result<T, ParserError>
Source§fn decode_default<'de, T: Deserialize<'de>>(
self,
value: Option<&'de Value>,
) -> Result<T, ParserError>
fn decode_default<'de, T: Deserialize<'de>>( self, value: Option<&'de Value>, ) -> Result<T, ParserError>
Convert any generic
Value
to a type with the default serde impl without binary + event tricks.
This is mainly used for connect payloads.Source§fn encode_default<T: ?Sized + Serialize>(
self,
data: &T,
) -> Result<Value, ParserError>
fn encode_default<T: ?Sized + Serialize>( self, data: &T, ) -> Result<Value, ParserError>
Convert any type to a generic
Value
with the default serde impl without binary + event tricks.
This is mainly used for connect payloads.Source§fn read_event(self, value: &Value) -> Result<&str, ParserError>
fn read_event(self, value: &Value) -> Result<&str, ParserError>
Try to read the event name from the given payload data.
The event name should be the first element of the provided array according to the serde model.
impl Copy for MsgPackParser
Auto Trait Implementations§
impl Freeze for MsgPackParser
impl RefUnwindSafe for MsgPackParser
impl Send for MsgPackParser
impl Sync for MsgPackParser
impl Unpin for MsgPackParser
impl UnwindSafe for MsgPackParser
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