Struct wavedrom::CycleOffset
source · pub struct CycleOffset { /* private fields */ }
Expand description
The cycle offset within multiple clock cycles. This is precise up until a quarter of a cycle.
Implementations§
source§impl CycleOffset
impl CycleOffset
sourcepub fn new(index: u32, in_offset: InCycleOffset) -> Self
pub fn new(index: u32, in_offset: InCycleOffset) -> Self
Create a new CycleOffset
with a specific cycle cycle index
and an in cycle cycle
offset in_offset
sourcepub fn new_rounded(index: u32) -> Self
pub fn new_rounded(index: u32) -> Self
Create a new CycleOffset
that is rounded to an specific cycle cycle index
sourcepub fn ceil_num_cycles(self) -> u32
pub fn ceil_num_cycles(self) -> u32
Get the a ceiled value of the number of cycles that the CycleOffset
incorperates.
sourcepub fn cycle_index(self) -> u32
pub fn cycle_index(self) -> u32
Get the index
of the CycleOffset
sourcepub fn in_cycle_offset(self) -> InCycleOffset
pub fn in_cycle_offset(self) -> InCycleOffset
Get the in cycle offset of the CycleOffset
sourcepub fn width_offset(self, width: u32) -> u32
pub fn width_offset(self, width: u32) -> u32
Get the width knowning that a cycle cycle is width
units wide.
sourcepub fn half(&self) -> CycleOffset
pub fn half(&self) -> CycleOffset
Half the CycleOffset
Trait Implementations§
source§impl Add<CycleOffset> for CycleOffset
impl Add<CycleOffset> for CycleOffset
source§impl AddAssign<CycleOffset> for CycleOffset
impl AddAssign<CycleOffset> for CycleOffset
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl Clone for CycleOffset
impl Clone for CycleOffset
source§fn clone(&self) -> CycleOffset
fn clone(&self) -> CycleOffset
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CycleOffset
impl Debug for CycleOffset
source§impl Default for CycleOffset
impl Default for CycleOffset
source§fn default() -> CycleOffset
fn default() -> CycleOffset
Returns the “default value” for a type. Read more
source§impl From<f32> for CycleOffset
impl From<f32> for CycleOffset
source§impl From<f64> for CycleOffset
impl From<f64> for CycleOffset
source§impl Ord for CycleOffset
impl Ord for CycleOffset
source§impl PartialEq<CycleOffset> for CycleOffset
impl PartialEq<CycleOffset> for CycleOffset
source§fn eq(&self, other: &CycleOffset) -> bool
fn eq(&self, other: &CycleOffset) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<CycleOffset> for CycleOffset
impl PartialOrd<CycleOffset> for CycleOffset
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moreimpl Copy for CycleOffset
impl Eq for CycleOffset
impl StructuralEq for CycleOffset
impl StructuralPartialEq for CycleOffset
Auto Trait Implementations§
impl RefUnwindSafe for CycleOffset
impl Send for CycleOffset
impl Sync for CycleOffset
impl Unpin for CycleOffset
impl UnwindSafe for CycleOffset
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