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: FastMessageTypeThe Type field of the Fast message
status: FastMessageStatusThe Status field of the Fast message
id: u32The Fast message identifier
msg_size: Option<usize>The length in bytes of the Fast message data payload
data: FastMessageDataThe data payload of the Fast message
Implementations§
Source§impl FastMessage
impl FastMessage
Sourcepub fn parse(buf: &[u8]) -> Result<FastMessage, FastParseError>
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.
Sourcepub fn check_buffer_size(buf: &[u8]) -> Result<(), FastParseError>
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.
Sourcepub fn parse_header(buf: &[u8]) -> Result<FastMessageHeader, FastParseError>
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.
Sourcepub fn data(msg_id: u32, data: FastMessageData) -> FastMessage
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.
Sourcepub fn end(msg_id: u32, method: String) -> FastMessage
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.
Sourcepub fn error(msg_id: u32, data: FastMessageData) -> FastMessage
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
impl Clone for FastMessage
Source§fn clone(&self) -> FastMessage
fn clone(&self) -> FastMessage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more