pub struct Frame {
pub header: FrameHeader,
pub contents: Bytes,
}Expand description
Packet framing structure
Fields§
§header: FrameHeaderHeader for the frame
contents: BytesThe encoded byte contents of the packet
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn response_raw(header: &FrameHeader, contents: Bytes) -> Frame
pub fn response_raw(header: &FrameHeader, contents: Bytes) -> Frame
Creates a new response frame responding to the provided header
with the bytes contents of value
§Arguments
header- The header of the frame to respond tocontents- The bytes of the frame
Sourcepub fn response<V>(header: &FrameHeader, value: V) -> Framewhere
V: TdfSerialize,
pub fn response<V>(header: &FrameHeader, value: V) -> Framewhere
V: TdfSerialize,
Creates a new response frame responding to the provided header
with the encoded contents of the value
§Arguments
header- The header of the frame to respond tovalue- The value to encode as the frame bytes
Sourcepub fn response_empty(header: &FrameHeader) -> Frame
pub fn response_empty(header: &FrameHeader) -> Frame
Creates a new response frame responding to the provided header
with empty contents
§Arguments
header- The header of the frame to respond to
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