Decoder

Struct Decoder 

Source
pub struct Decoder { /* private fields */ }
Expand description

Decoder for FAST protocol messages.

Implementations§

Source§

impl Decoder

Source

pub fn new_from_xml(text: &str) -> Result<Self>

Source

pub fn reset(&mut self)

Source

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.

Source

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.

Source

pub fn decode_vec( &mut self, bytes: Vec<u8>, msg: &mut impl MessageFactory, ) -> Result<()>

👎Deprecated since 0.3.4: use decode_buffer() instead

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.

Source

pub fn decode_bytes( &mut self, bytes: &mut Bytes, msg: &mut impl MessageFactory, ) -> Result<()>

Decode single message from bytes::Bytes.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.