[−][src]Struct fizyr_rpc::MessageHeader
A message header.
Fields
message_type: MessageType
The message type.
request_id: u32
The request that the message is part of.
Unused for stream messages.
service_id: i32
The service that the message is for.
For request messages, this indicates the service being requested.
For response messages this indicates success or failure.
For update messages this indicates the type of update.
Implementations
impl MessageHeader
[src]
pub fn request(request_id: u32, service_id: i32) -> Self
[src]
Create a new request message header.
pub fn response(request_id: u32, service_id: i32) -> Self
[src]
Create a new response message header.
pub fn error_response(request_id: u32) -> Self
[src]
Create a new error response message header.
pub fn requester_update(request_id: u32, service_id: i32) -> Self
[src]
Create a new requester update message header.
pub fn responder_update(request_id: u32, service_id: i32) -> Self
[src]
Create a new responder update message header.
pub fn stream(request_id: u32, service_id: i32) -> Self
[src]
Create a new stream message header.
pub fn decode(buffer: &[u8]) -> Result<Self, InvalidMessageType>
[src]
Decode a message header from a byte slice.
The byte slice should NOT contain the message size.
Panic
This function panics if the buffer does not contain a full header.
pub fn encode(&self, buffer: &mut [u8])
[src]
Encode a message header into a byte slice.
This will NOT add a message size (which would be impossible even if we wanted to).
Panic
This function panics if the buffer is not large enough to hold a full header.
Trait Implementations
impl Clone for MessageHeader
[src]
fn clone(&self) -> MessageHeader
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for MessageHeader
[src]
impl Debug for MessageHeader
[src]
impl Eq for MessageHeader
[src]
impl Hash for MessageHeader
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for MessageHeader
[src]
fn cmp(&self, other: &MessageHeader) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<MessageHeader> for MessageHeader
[src]
fn eq(&self, other: &MessageHeader) -> bool
[src]
fn ne(&self, other: &MessageHeader) -> bool
[src]
impl PartialOrd<MessageHeader> for MessageHeader
[src]
fn partial_cmp(&self, other: &MessageHeader) -> Option<Ordering>
[src]
fn lt(&self, other: &MessageHeader) -> bool
[src]
fn le(&self, other: &MessageHeader) -> bool
[src]
fn gt(&self, other: &MessageHeader) -> bool
[src]
fn ge(&self, other: &MessageHeader) -> bool
[src]
impl StructuralEq for MessageHeader
[src]
impl StructuralPartialEq for MessageHeader
[src]
Auto Trait Implementations
impl RefUnwindSafe for MessageHeader
impl Send for MessageHeader
impl Sync for MessageHeader
impl Unpin for MessageHeader
impl UnwindSafe for MessageHeader
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,
pub 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,