[−][src]Struct fast_rpc::protocol::FastMessage
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]
fn clone(&self) -> FastMessage
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for FastMessage
[src]
impl PartialEq<FastMessage> for FastMessage
[src]
Auto Trait Implementations
impl RefUnwindSafe for FastMessage
impl Send for FastMessage
impl Sync for FastMessage
impl Unpin for FastMessage
impl UnwindSafe for FastMessage
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,