ObjectFlags

Struct ObjectFlags 

Source
pub struct ObjectFlags<const N: usize> { /* private fields */ }
Expand description

Stores an event flag for each sub object in an object

PDO transmission can be triggered by events, but PDOs are runtime configurable. An application needs to be able to signal that an object has changed, and if that object is mapped to a TPDO, that PDO should be scheduled for transmission.

In order to achieve this in a synchronized way without long critical sections, each object holds two sets of flags, and they are swapped atomically using a global ObjectFlagSync shared by all ObjectFlags instances.

Implementations§

Source§

impl<const N: usize> ObjectFlags<N>

Source

pub const fn new(sync: &'static ObjectFlagSync) -> Self

Create a new ObjectFlags

Trait Implementations§

Source§

impl<const N: usize> ObjectFlagAccess for ObjectFlags<N>

Source§

fn set_flag(&self, sub: u8)

Set the flag for the specified sub object Read more
Source§

fn get_flag(&self, sub: u8) -> bool

Read the flag for the specified object Read more
Source§

fn clear(&self)

Clear all flags in the currently active flag set

Auto Trait Implementations§

§

impl<const N: usize> !Freeze for ObjectFlags<N>

§

impl<const N: usize> !RefUnwindSafe for ObjectFlags<N>

§

impl<const N: usize> Send for ObjectFlags<N>

§

impl<const N: usize> Sync for ObjectFlags<N>

§

impl<const N: usize> Unpin for ObjectFlags<N>

§

impl<const N: usize> !UnwindSafe for ObjectFlags<N>

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.