pub struct Frame {
pub desc: MsgDescHot,
pub payload: Payload,
}Expand description
Owned frame for sending, receiving, or routing.
Fields§
§desc: MsgDescHotThe frame descriptor.
payload: PayloadPayload storage for this frame.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn new(desc: MsgDescHot) -> Self
pub fn new(desc: MsgDescHot) -> Self
Create a new frame with no payload (inline empty).
Sourcepub fn with_inline_payload(desc: MsgDescHot, payload: &[u8]) -> Option<Self>
pub fn with_inline_payload(desc: MsgDescHot, payload: &[u8]) -> Option<Self>
Create a frame with inline payload.
Sourcepub fn with_payload(desc: MsgDescHot, payload: Vec<u8>) -> Self
pub fn with_payload(desc: MsgDescHot, payload: Vec<u8>) -> Self
Create a frame with an owned payload allocation.
Sourcepub fn with_bytes(desc: MsgDescHot, payload: Bytes) -> Self
pub fn with_bytes(desc: MsgDescHot, payload: Bytes) -> Self
Create a frame with a ref-counted bytes buffer.
Sourcepub fn payload_bytes(&self) -> &[u8] ⓘ
pub fn payload_bytes(&self) -> &[u8] ⓘ
Borrow the payload as bytes.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnwindSafe for Frame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more