pub struct CanNodeId(_);
Expand description

Node ID

Valid node IDs are in the range 0..=127 (7 bits). IDs 126 and 127 are reserved for diagnostic and debugging tools.

Implementations§

source§

impl CanNodeId

source

pub const MIN: CanNodeId = _

The smallest allowed node ID (0)

source

pub const MAX: CanNodeId = _

The largest allowed node ID (127)

source

pub const fn to_u8(self) -> u8

Returns the integer value of this node ID

source

pub const fn from_truncating(value: u8) -> Self

Creates a valid NodeID from a u8, truncating values that are out of range

source

pub fn is_diagnostic_reserved(self) -> bool

Returns true if this node ID is one of the two highest values, which are reserved for diagnostic and debugging tools

Trait Implementations§

source§

impl Clone for CanNodeId

source§

fn clone(&self) -> CanNodeId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CanNodeId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CanNodeId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<CanNodeId> for u16

source§

fn from(id: CanNodeId) -> Self

Converts to this type from the input type.
source§

impl From<CanNodeId> for u32

source§

fn from(id: CanNodeId) -> Self

Converts to this type from the input type.
source§

impl From<CanNodeId> for u8

source§

fn from(id: CanNodeId) -> Self

Converts to this type from the input type.
source§

impl From<CanNodeId> for usize

source§

fn from(id: CanNodeId) -> Self

Converts to this type from the input type.
source§

impl Hash for CanNodeId

source§

fn hash<H: Hasher>(&self, _h: &mut H)

Feeds this value into the given Hasher.
source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher.
source§

impl Ord for CanNodeId

source§

fn cmp(&self, other: &CanNodeId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<CanNodeId> for CanNodeId

source§

fn eq(&self, other: &CanNodeId) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<CanNodeId> for CanNodeId

source§

fn partial_cmp(&self, other: &CanNodeId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl TryFrom<u16> for CanNodeId

§

type Error = InvalidValue

The type returned in the event of a conversion error.
source§

fn try_from(value: u16) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<u8> for CanNodeId

§

type Error = InvalidValue

The type returned in the event of a conversion error.
source§

fn try_from(bits: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for CanNodeId

source§

impl Eq for CanNodeId

source§

impl StructuralEq for CanNodeId

source§

impl StructuralPartialEq for CanNodeId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.