pub struct Label {
pub start: Option<u64>,
pub end: Option<u64>,
pub text: String,
pub score: Option<f64>,
}Expand description
a single labelled segment, times are in 100ns units as stored in the
file, use the *_secs methods to work in seconds
Fields§
§start: Option<u64>start time in 100ns units
end: Option<u64>end time in 100ns units
text: Stringthe label text, e.g. a phone or word
score: Option<f64>optional score following the label text
Implementations§
Source§impl Label
impl Label
Sourcepub fn new(start: u64, end: u64, text: impl Into<String>) -> Self
pub fn new(start: u64, end: u64, text: impl Into<String>) -> Self
creates a label spanning start..end in 100ns units
Sourcepub fn from_secs(start: f64, end: f64, text: impl Into<String>) -> Self
pub fn from_secs(start: f64, end: f64, text: impl Into<String>) -> Self
creates a label spanning start..end given in seconds
Sourcepub fn start_secs(&self) -> Option<f64>
pub fn start_secs(&self) -> Option<f64>
start time in seconds
Sourcepub fn duration_secs(&self) -> Option<f64>
pub fn duration_secs(&self) -> Option<f64>
duration in seconds, if both times are present
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Label
impl<'de> Deserialize<'de> for Label
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromIterator<Label> for LabFile
impl FromIterator<Label> for LabFile
impl StructuralPartialEq for Label
Auto Trait Implementations§
impl Freeze for Label
impl RefUnwindSafe for Label
impl Send for Label
impl Sync for Label
impl Unpin for Label
impl UnsafeUnpin for Label
impl UnwindSafe for Label
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