pub struct SdoId(/* private fields */);Expand description
A wrapper type for PTP Sdo Identifiers.
Because SdoIds are 12 bit values they always lie within 0..=0xFFF.
For more details, see IEEE1588-2019 table 2 in section 7.1.4.
§Example
assert_eq!(SdoId::default(), SdoId::try_from(0x000).unwrap());
let sdo_id = SdoId::try_from(0x100).unwrap();
assert_eq!(u16::from(sdo_id), 0x100);
assert!(SdoId::try_from(0x1000).is_err());Trait Implementations§
impl Copy for SdoId
Source§impl<'de> Deserialize<'de> for SdoId
Available on crate feature serde only.
impl<'de> Deserialize<'de> for SdoId
Available on crate feature
serde only.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
impl Eq for SdoId
impl StructuralPartialEq for SdoId
Auto Trait Implementations§
impl Forget for SdoId
impl Freeze for SdoId
impl Move for SdoId
impl RefUnwindSafe for SdoId
impl Send for SdoId
impl Sync for SdoId
impl Unpin for SdoId
impl UnsafeUnpin for SdoId
impl UnwindSafe for SdoId
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