pub struct Decoder { /* private fields */ }Expand description
Decoder for FAST protocol messages.
Implementations§
Source§impl Decoder
impl Decoder
pub fn new_from_xml(text: &str) -> Result<Self>
pub fn reset(&mut self)
Sourcepub fn decode_buffer(
&mut self,
buffer: &[u8],
msg: &mut impl MessageFactory,
) -> Result<u64>
pub fn decode_buffer( &mut self, buffer: &[u8], msg: &mut impl MessageFactory, ) -> Result<u64>
Decode single message from buffer. Returns number of bytes consumed from the buffer.
Sourcepub fn decode_slice(
&mut self,
bytes: &[u8],
msg: &mut impl MessageFactory,
) -> Result<()>
pub fn decode_slice( &mut self, bytes: &[u8], msg: &mut impl MessageFactory, ) -> Result<()>
Decode single message from slice.
The bytes slice must be consumed completely. It is an error if any bytes left after the message is decoded.
Sourcepub fn decode_vec(
&mut self,
bytes: Vec<u8>,
msg: &mut impl MessageFactory,
) -> Result<()>
👎Deprecated since 0.3.4: use decode_buffer() instead
pub fn decode_vec( &mut self, bytes: Vec<u8>, msg: &mut impl MessageFactory, ) -> Result<()>
Decode single message from bytes vector.
The bytes vector must be the whole message. It is an error if any bytes left after the message is decoded.
Sourcepub fn decode_bytes(
&mut self,
bytes: &mut Bytes,
msg: &mut impl MessageFactory,
) -> Result<()>
pub fn decode_bytes( &mut self, bytes: &mut Bytes, msg: &mut impl MessageFactory, ) -> Result<()>
Decode single message from bytes::Bytes.
Sourcepub fn decode_stream(
&mut self,
rdr: &mut dyn Read,
msg: &mut impl MessageFactory,
) -> Result<()>
pub fn decode_stream( &mut self, rdr: &mut dyn Read, msg: &mut impl MessageFactory, ) -> Result<()>
Decode single message from object that implements std::io::Read trait.
Sourcepub fn decode_reader(
&mut self,
rdr: &mut impl Reader,
msg: &mut impl MessageFactory,
) -> Result<()>
pub fn decode_reader( &mut self, rdr: &mut impl Reader, msg: &mut impl MessageFactory, ) -> Result<()>
Decode single message from object that implements fastlib::Reader trait.
Auto Trait Implementations§
impl Freeze for Decoder
impl !RefUnwindSafe for Decoder
impl !Send for Decoder
impl !Sync for Decoder
impl Unpin for Decoder
impl !UnwindSafe for Decoder
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