NodeState

Struct NodeState 

Source
pub struct NodeState<const N_RPDO: usize, const N_TPDO: usize> { /* private fields */ }
Expand description

The NodeState provides config-dependent storage to the Node object

The node state has to get instantiated (statically) by zencan-build, based on the device config file. It is then provided to the node by the application when it is instantiated, and accessed via the NodeStateAccess trait.

Implementations§

Source§

impl<const N_RPDO: usize, const N_TPDO: usize> NodeState<N_RPDO, N_TPDO>

Source

pub const fn new() -> Self

Create a new NodeState object

Source

pub const fn rpdos(&'static self) -> &'static [Pdo]

Access the RPDOs as a const function

Source

pub const fn tpdos(&'static self) -> &'static [Pdo]

Access the TPDOs as a const function

Source

pub const fn pdo_sync(&'static self) -> &'static ObjectFlagSync

Access the pdo_sync as a const function

This is required so that it can be shared with the objects in generated code

Source

pub const fn storage_context(&'static self) -> &'static StorageContext

Access the storage_context as a const function

Trait Implementations§

Source§

impl<const N_RPDO: usize, const N_TPDO: usize> Default for NodeState<N_RPDO, N_TPDO>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<const N_RPDO: usize, const N_TPDO: usize> NodeStateAccess for NodeState<N_RPDO, N_TPDO>

Source§

fn get_rpdos(&self) -> &[Pdo]

Get the receive PDO objects
Source§

fn get_tpdos(&self) -> &[Pdo]

Get the transmit PDO objects
Source§

fn get_pdo_sync(&self) -> &ObjectFlagSync

Get the PDO flag sync object
Source§

fn storage_context(&self) -> &StorageContext

Get the storage context object

Auto Trait Implementations§

§

impl<const N_RPDO: usize, const N_TPDO: usize> !Freeze for NodeState<N_RPDO, N_TPDO>

§

impl<const N_RPDO: usize, const N_TPDO: usize> !RefUnwindSafe for NodeState<N_RPDO, N_TPDO>

§

impl<const N_RPDO: usize, const N_TPDO: usize> Send for NodeState<N_RPDO, N_TPDO>

§

impl<const N_RPDO: usize, const N_TPDO: usize> Sync for NodeState<N_RPDO, N_TPDO>

§

impl<const N_RPDO: usize, const N_TPDO: usize> Unpin for NodeState<N_RPDO, N_TPDO>

§

impl<const N_RPDO: usize, const N_TPDO: usize> !UnwindSafe for NodeState<N_RPDO, N_TPDO>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.