pub struct PacketId {
pub ptype: PacketType,
pub sec_header_flag: bool,
/* private fields */
}Expand description
Abstraction for the CCSDS Packet ID, which forms the last thirteen bits of the first two bytes in the CCSDS primary header.
Fields§
§ptype: PacketType§sec_header_flag: boolImplementations§
Source§impl PacketId
impl PacketId
Sourcepub const fn new_for_tc(sec_header: bool, apid: u16) -> Self
pub const fn new_for_tc(sec_header: bool, apid: u16) -> Self
This constructor will panic if the passed APID exceeds MAX_APID. Use the checked constructor variants to avoid panics.
Sourcepub const fn new_for_tm(sec_header: bool, apid: u16) -> Self
pub const fn new_for_tm(sec_header: bool, apid: u16) -> Self
This constructor will panic if the passed APID exceeds MAX_APID. Use the checked constructor variants to avoid panics.
pub fn new_for_tc_checked(sec_header: bool, apid: u16) -> Option<Self>
pub fn new_for_tm_checked(sec_header: bool, apid: u16) -> Option<Self>
Sourcepub const fn new(ptype: PacketType, sec_header: bool, apid: u16) -> Self
pub const fn new(ptype: PacketType, sec_header: bool, apid: u16) -> Self
This constructor will panic if the passed APID exceeds MAX_APID. Use the checked variants to avoid panics.
pub fn new_checked( ptype: PacketType, sec_header_flag: bool, apid: u16, ) -> Option<PacketId>
Sourcepub fn set_apid(&mut self, apid: u16) -> bool
pub fn set_apid(&mut self, apid: u16) -> bool
Set a new Application Process ID (APID). If the passed number is invalid, the APID will not be set and false will be returned. The maximum allowed value for the 11-bit field is 2047
pub fn apid(&self) -> u16
pub fn raw(&self) -> u16
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PacketId
impl<'de> Deserialize<'de> for PacketId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for PacketId
impl Ord for PacketId
Source§impl PartialOrd for PacketId
impl PartialOrd for PacketId
impl Copy for PacketId
impl Eq for PacketId
Auto Trait Implementations§
impl Freeze for PacketId
impl RefUnwindSafe for PacketId
impl Send for PacketId
impl Sync for PacketId
impl Unpin for PacketId
impl UnwindSafe for PacketId
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