pub struct TlpPacketHeader { /* private fields */ }Expand description
TLP Packet Header Contains bytes for Packet header and informations about TLP type
Implementations§
Source§impl TlpPacketHeader
impl TlpPacketHeader
Sourcepub fn new(bytes: Vec<u8>, mode: TlpMode) -> Result<TlpPacketHeader, TlpError>
pub fn new(bytes: Vec<u8>, mode: TlpMode) -> Result<TlpPacketHeader, TlpError>
Create a new TlpPacketHeader from raw bytes and the specified framing mode.
Use TlpMode::NonFlit for PCIe 1.0–5.0 standard TLP framing.
TlpMode::Flit is reserved for future PCIe 6.0 support and currently
returns Err(TlpError::NotImplemented).
§Errors
TlpError::InvalidLengthifbytes.len() < 4.TlpError::NotImplementedifmodeisTlpMode::Flit.
Sourcepub fn tlp_type(&self) -> Result<TlpType, TlpError>
pub fn tlp_type(&self) -> Result<TlpType, TlpError>
Decode and return the TLP type from the DW0 header fields.
§Errors
TlpError::InvalidFormatif the 3-bit Fmt field is not a known value.TlpError::InvalidTypeif the 5-bit Type field is not a known value.TlpError::UnsupportedCombinationif Fmt and Type are individually valid but not a legal pair (e.g. IO Request with 4DW header).
Sourcepub fn get_tlp_type(&self) -> Result<TlpType, TlpError>
👎Deprecated since 0.5.0: use tlp_type() instead
pub fn get_tlp_type(&self) -> Result<TlpType, TlpError>
use tlp_type() instead
Decode and return the TLP type from the DW0 header fields.
§Deprecation
Prefer TlpPacketHeader::tlp_type which follows Rust naming conventions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TlpPacketHeader
impl RefUnwindSafe for TlpPacketHeader
impl Send for TlpPacketHeader
impl Sync for TlpPacketHeader
impl Unpin for TlpPacketHeader
impl UnsafeUnpin for TlpPacketHeader
impl UnwindSafe for TlpPacketHeader
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