pub struct SyncCounter { /* private fields */ }Expand description
The counter for a SYNC producer (CiA 301 §7.2.5.2.1).
When enabled, the counter cycles 1..=overflow and wraps back to 1.
Constructed from the object 0x1019 overflow value: 0 (or the reserved
1) means the producer emits empty SYNC frames, so SyncCounter::advance
yields None.
Implementations§
Source§impl SyncCounter
impl SyncCounter
Sourcepub fn new(overflow: u8) -> Result<Self>
pub fn new(overflow: u8) -> Result<Self>
Create a SYNC counter from an overflow value.
Returns Error::InvalidSyncCounter unless overflow is 0 or in
2..=240.
Sourcepub const fn is_counting(&self) -> bool
pub const fn is_counting(&self) -> bool
Whether this producer emits a counter (overflow in 2..=240).
Trait Implementations§
Source§impl Clone for SyncCounter
impl Clone for SyncCounter
Source§fn clone(&self) -> SyncCounter
fn clone(&self) -> SyncCounter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SyncCounter
Auto Trait Implementations§
impl Freeze for SyncCounter
impl RefUnwindSafe for SyncCounter
impl Send for SyncCounter
impl Sync for SyncCounter
impl Unpin for SyncCounter
impl UnsafeUnpin for SyncCounter
impl UnwindSafe for SyncCounter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more