[][src]Struct fast_rpc::protocol::FastMessage

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

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

Methods

impl FastMessage[src]

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

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

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

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

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

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

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

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

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

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.

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

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

Trait Implementations

impl Clone for FastMessage[src]

impl Debug for FastMessage[src]

impl PartialEq<FastMessage> for FastMessage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.