pub struct MctpSerialMedium;Trait Implementations§
Source§impl Clone for MctpSerialMedium
impl Clone for MctpSerialMedium
Source§fn clone(&self) -> MctpSerialMedium
fn clone(&self) -> MctpSerialMedium
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MctpSerialMedium
impl Debug for MctpSerialMedium
Source§impl Format for MctpSerialMedium
impl Format for MctpSerialMedium
Source§impl MctpMedium for MctpSerialMedium
impl MctpMedium for MctpSerialMedium
Source§type Frame = MctpSerialMediumFrame
type Frame = MctpSerialMediumFrame
the medium specific header and trailer for the packet
type ReplyContext = ()
Source§type Encoding = SerialEncoding
type Encoding = SerialEncoding
the byte-stuffing transform used by this medium when (de)serializing
wire bytes. Stateless — see [
crate::buffer_encoding]. Most media
use PassthroughEncoding
(no transform); media that need byte-stuffing (e.g., DSP0253 serial)
supply their own impl.Source§fn max_message_body_size(&self) -> usize
fn max_message_body_size(&self) -> usize
the maximum transmission unit for the medium
Source§fn deserialize<'buf>(
&self,
packet: &'buf [u8],
) -> MctpPacketResult<(Self::Frame, EncodingDecoder<'buf, Self::Encoding>), Self>
fn deserialize<'buf>( &self, packet: &'buf [u8], ) -> MctpPacketResult<(Self::Frame, EncodingDecoder<'buf, Self::Encoding>), Self>
Deserialize a packet into the medium-specific header (frame) and an
EncodingDecoder that wraps the inner stuffed-region bytes.
Higher layers (e.g., parse_transport_header, the payload copy
loop in MctpPacketContext) read decoded bytes through the
returned decoder and physically cannot bypass the medium’s
encoding by slicing the underlying buffer directly.Source§fn serialize<'buf, F>(
&self,
_reply_context: Self::ReplyContext,
buffer: &'buf mut [u8],
message_writer: F,
) -> MctpPacketResult<&'buf [u8], Self>
fn serialize<'buf, F>( &self, _reply_context: Self::ReplyContext, buffer: &'buf mut [u8], message_writer: F, ) -> MctpPacketResult<&'buf [u8], Self>
Serialize a packet by allowing the caller’s
message_writer
closure to write decoded bytes into the medium’s stuffed region
through an EncodingEncoder. The medium owns its outer framing
(e.g., SMBus header + PEC, DSP0253 start/end flags + FCS) and
inspects the encoder’s
wire_position after the
closure returns to size headers/trailers and compute checksums.Source§impl MctpMediumFrame<MctpSerialMedium> for MctpSerialMediumFrame
impl MctpMediumFrame<MctpSerialMedium> for MctpSerialMediumFrame
fn packet_size(&self) -> usize
fn reply_context(&self)
Source§impl PartialEq for MctpSerialMedium
impl PartialEq for MctpSerialMedium
impl Copy for MctpSerialMedium
impl Eq for MctpSerialMedium
impl StructuralPartialEq for MctpSerialMedium
Auto Trait Implementations§
impl Freeze for MctpSerialMedium
impl RefUnwindSafe for MctpSerialMedium
impl Send for MctpSerialMedium
impl Sync for MctpSerialMedium
impl Unpin for MctpSerialMedium
impl UnsafeUnpin for MctpSerialMedium
impl UnwindSafe for MctpSerialMedium
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