pub enum Frame {
Data(Data),
Hello(Hello),
Start(Start),
Ack(),
Bye(),
}Expand description
Core network frame definition
Variants§
Data(Data)
Frame of Data
Hello(Hello)
Hello, used to initiate network channels
Start(Start)
Start, used to initiate network channels
Ack()
Ack to acknowledge that the connection is started.
Bye()
Bye to signal that a channel is closing.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn frame_type(&self) -> FrameType
pub fn frame_type(&self) -> FrameType
Returns which FrameType a Frame is.
Sourcepub fn encode_into<B>(&mut self, dst: &mut B) -> Result<(), FramingError>where
B: BufMut,
pub fn encode_into<B>(&mut self, dst: &mut B) -> Result<(), FramingError>where
B: BufMut,
Encode a frame into a BufMut
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the number of bytes required to serialize this frame
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 UnsafeUnpin 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