Expand description
Represents an AMS NetID.
The NetID consists of 6 bytes commonly written like an IPv4 address, i.e.
1.2.3.4.5.6
. Together with an AMS port (16-bit integer), it uniquely
identifies an endpoint of an ADS system that can be communicated with.
Although often the first 4 bytes of a NetID look like an IP address, and sometimes even are identical to the device’s IP address, there is no requirement for this, and one should never rely on it.
Tuple Fields
0: [u8; 6]
Implementations
sourceimpl AmsNetId
impl AmsNetId
sourcepub const fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> Self
pub const fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> Self
Create a NetID from six bytes.
sourcepub fn from_slice(slice: &[u8]) -> Option<Self>
pub fn from_slice(slice: &[u8]) -> Option<Self>
Create a NetID from a slice (which must have length 6).
Trait Implementations
sourceimpl AsBytes for AmsNetId
impl AsBytes for AmsNetId
sourceimpl Ord for AmsNetId
impl Ord for AmsNetId
sourceimpl PartialOrd<AmsNetId> for AmsNetId
impl PartialOrd<AmsNetId> for AmsNetId
sourcefn partial_cmp(&self, other: &AmsNetId) -> Option<Ordering>
fn partial_cmp(&self, other: &AmsNetId) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for AmsNetId
impl Eq for AmsNetId
impl FromBytes for AmsNetId
impl StructuralEq for AmsNetId
impl StructuralPartialEq for AmsNetId
Auto Trait Implementations
impl RefUnwindSafe for AmsNetId
impl Send for AmsNetId
impl Sync for AmsNetId
impl Unpin for AmsNetId
impl UnwindSafe for AmsNetId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more