pub struct Segment {
pub data: Vec<u16>,
pub time_interval: u16,
}
Expand description
A waveform segment.
Fields§
§data: Vec<u16>
The waveform samples.
time_interval: u16
The time interval, in cycles.
Implementations§
Source§impl Segment
impl Segment
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<Segment>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Segment>
Reads a Segment from a path.
§Examples
use df2::Segment;
let segment = Segment::from_path("data/one-segment.bin").unwrap();
Sourcepub fn from_read<R: Read>(read: &mut R) -> Result<Segment>
pub fn from_read<R: Read>(read: &mut R) -> Result<Segment>
Reads a Segment from a Read
.
§Examples
use std::fs::File;
use df2::Segment;
let mut file = File::open("data/one-segment.bin").unwrap();
let segment = Segment::from_read(&mut file).unwrap();
Trait Implementations§
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnwindSafe for Segment
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