leodos_protocols/transport/cfdp/pdu/tlv/
entity_id.rs1use zerocopy::FromBytes;
2use zerocopy::Immutable;
3use zerocopy::IntoBytes;
4use zerocopy::KnownLayout;
5use zerocopy::Unaligned;
6
7use crate::transport::cfdp::CfdpError;
8use crate::transport::cfdp::pdu::EntityId;
9
10#[repr(C)]
12#[derive(Debug, FromBytes, IntoBytes, Unaligned, KnownLayout, Immutable)]
13pub struct TlvEntityId {
14 rest: [u8],
16}
17
18impl TlvEntityId {
19 pub fn id(&self) -> Result<EntityId, CfdpError> {
21 EntityId::from_bytes(&self.rest)
22 }
23}