pub struct Wave<'a> { /* private fields */ }Expand description
A read-only view over a recorded waveform.
Implementations§
Source§impl<'a> Wave<'a>
impl<'a> Wave<'a>
pub fn new(points: &'a [(Tick, Level)]) -> Self
Sourcepub fn at(&self, at: Tick) -> Option<Level>
pub fn at(&self, at: Tick) -> Option<Level>
The level held at at: the last point at or before it.
Sourcepub fn edges(&self) -> impl Iterator<Item = (Tick, Level)> + '_
pub fn edges(&self) -> impl Iterator<Item = (Tick, Level)> + '_
Change points: (tick, level after the change), in order.
Sourcepub fn shortest_run(&self) -> Option<u64>
pub fn shortest_run(&self) -> Option<u64>
Shortest run between consecutive changes, in ticks.
The first entry is the level held when recording started, not a change, so the segment before the first change is open on the left: how long the line had already been idle is not part of the record. It is skipped, which matters when a capture begins just before the first byte and that idle looks shorter than one bit. Repeated ticks (a malformed record) are skipped too: they describe no run.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Wave<'a>
impl<'a> Freeze for Wave<'a>
impl<'a> Move for Wave<'a>
impl<'a> RefUnwindSafe for Wave<'a>
impl<'a> Send for Wave<'a>
impl<'a> Sync for Wave<'a>
impl<'a> Unpin for Wave<'a>
impl<'a> UnsafeUnpin for Wave<'a>
impl<'a> UnwindSafe for Wave<'a>
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