pub enum OutboundFrame {
Message(MessageFrame<Message>),
Raw(SerializedFrame),
}Expand description
A frame on its way out, for a sender that has either kind to send: a message the encoder will serialize, or bytes that were framed by hand, as the TLV path does.
Variants§
Message(MessageFrame<Message>)
A message the encoder serializes on the way out.
Raw(SerializedFrame)
A frame that is already serialized, written out as it is.
Implementations§
Source§impl OutboundFrame
impl OutboundFrame
Sourcepub fn from_message(message: Message) -> Result<Self, ParserError>
pub fn from_message(message: Message) -> Result<Self, ParserError>
Frames message for the encoder to serialize as it writes it out.
Trait Implementations§
Source§impl Debug for OutboundFrame
impl Debug for OutboundFrame
Source§impl EncodableFrame for OutboundFrame
impl EncodableFrame for OutboundFrame
Source§fn encoded_length(&self) -> usize
fn encoded_length(&self) -> usize
Returns the length the frame takes once encoded, which includes the
crate::header::Header and so is never below crate::SV2_FRAME_HEADER_SIZE. An
encoder rejects a frame that reports less than that.Source§fn encode_into(self, dst: &mut [u8]) -> Result<(), Error>
fn encode_into(self, dst: &mut [u8]) -> Result<(), Error>
Writes the frame into
dst, erroring out unless dst is exactly Self::encoded_length
long. A longer dst is refused rather than left with whatever it held past the frame,
which a caller that sends the whole buffer would send along.Source§impl From<MessageFrame<AnyMessageOwned>> for OutboundFrame
impl From<MessageFrame<AnyMessageOwned>> for OutboundFrame
Source§fn from(frame: MessageFrame<Message>) -> Self
fn from(frame: MessageFrame<Message>) -> Self
Converts to this type from the input type.
Source§impl From<SerializedFrame<<BufferPool<BufferFromSystemMemory> as Buffer>::Slice>> for OutboundFrame
impl From<SerializedFrame<<BufferPool<BufferFromSystemMemory> as Buffer>::Slice>> for OutboundFrame
Source§fn from(frame: SerializedFrame) -> Self
fn from(frame: SerializedFrame) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Sync for OutboundFrame
impl Freeze for OutboundFrame
impl RefUnwindSafe for OutboundFrame
impl Send for OutboundFrame
impl Unpin for OutboundFrame
impl UnsafeUnpin for OutboundFrame
impl UnwindSafe for OutboundFrame
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