Struct FastMessage

Source
pub struct FastMessage {
    pub msg_type: FastMessageType,
    pub status: FastMessageStatus,
    pub id: u32,
    pub msg_size: Option<usize>,
    pub data: FastMessageData,
}
Expand description

Represents a Fast message including the header and data payload

Fields§

§msg_type: FastMessageType

The Type field of the Fast message

§status: FastMessageStatus

The Status field of the Fast message

§id: u32

The Fast message identifier

§msg_size: Option<usize>

The length in bytes of the Fast message data payload

§data: FastMessageData

The data payload of the Fast message

Implementations§

Source§

impl FastMessage

Source

pub fn parse(buf: &[u8]) -> Result<FastMessage, FastParseError>

Parse a byte buffer into a FastMessage. Returns a FastParseError if the available bytes cannot be parsed to a FastMessage.

Source

pub fn check_buffer_size(buf: &[u8]) -> Result<(), FastParseError>

Check that the provided byte buffer contains at least FP_HEADER_SZ bytes. Returns a FastParseError if this is not the case.

Source

pub fn parse_header(buf: &[u8]) -> Result<FastMessageHeader, FastParseError>

Parse a portion of a byte buffer into a FastMessageHeader. Returns a FastParseError if the available bytes cannot be parsed to a FastMessageHeader.

Source

pub fn data(msg_id: u32, data: FastMessageData) -> FastMessage

Returns a FastMessage that represents a Fast protocol DATA message with the provided message identifer and data payload.

Source

pub fn end(msg_id: u32, method: String) -> FastMessage

Returns a FastMessage that represents a Fast protocol END message with the provided message identifer. The method parameter is used in the otherwise empty data payload.

Source

pub fn error(msg_id: u32, data: FastMessageData) -> FastMessage

Returns a FastMessage that represents a Fast protocol ERROR message with the provided message identifer and data payload.

Trait Implementations§

Source§

impl Clone for FastMessage

Source§

fn clone(&self) -> FastMessage

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FastMessage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for FastMessage

Source§

fn eq(&self, other: &FastMessage) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,