Struct ads::AmsNetId
[−]
[src]
pub struct AmsNetId(pub [u8; 6]);
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.
Methods
impl AmsNetId
[src]
pub fn new(a: u8, b: u8, c: u8, d: u8, e: u8, f: u8) -> Self
[src]
Create a NetID from six bytes.
pub fn from_slice(slice: &[u8]) -> Self
[src]
Create a NetID from a slice (which must have length 6).
pub fn is_zero(&self) -> bool
[src]
Check if the NetID is all-zero.
Trait Implementations
impl Clone for AmsNetId
[src]
fn clone(&self) -> AmsNetId
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Copy for AmsNetId
[src]
impl PartialEq for AmsNetId
[src]
fn eq(&self, __arg_0: &AmsNetId) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &AmsNetId) -> bool
[src]
This method tests for !=
.
impl Eq for AmsNetId
[src]
impl PartialOrd for AmsNetId
[src]
fn partial_cmp(&self, __arg_0: &AmsNetId) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &AmsNetId) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &AmsNetId) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &AmsNetId) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &AmsNetId) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for AmsNetId
[src]
fn cmp(&self, __arg_0: &AmsNetId) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl Default for AmsNetId
[src]
impl FromStr for AmsNetId
[src]
type Err = &'static str
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<AmsNetId, &'static str>
[src]
Parse a NetID from a string (a.b.c.d.e.f
).
Bytes can be missing in the end; missing bytes are substituted by 1.