pub struct Segment {
pub element: Box<dyn Element>,
pub timing: Timing,
pub name: Option<String>,
}
Fields§
§element: Box<dyn Element>
The element this segment represents.
timing: Timing
The timing interval this segment spans.
name: Option<String>
An optional name. When being rendered, this segment’s Rng are seeded with a combined hash of this name as well as the segment’s parent seed.
Implementations§
Source§impl Segment
impl Segment
Sourcepub fn unnamed(self) -> Self
pub fn unnamed(self) -> Self
Removes the Segment
’s a name, if it has one, returning the resulting unnamed segment.
Sourcepub fn element_as<Element: Element>(&self) -> Option<&Element>
pub fn element_as<Element: Element>(&self) -> Option<&Element>
Gets the contained element if its type matches type Element
, otherwise, None
is
returned.
Trait Implementations§
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
Source§impl<T, R> RangeOps<T> for Rwhere
T: PartialOrd,
R: RangeBounds<T>,
impl<T, R> RangeOps<T> for Rwhere
T: PartialOrd,
R: RangeBounds<T>,
Source§fn is_before(&self, other: &impl RangeBounds<T>) -> bool
fn is_before(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval ends before the start of another.
Source§fn is_after(&self, other: &impl RangeBounds<T>) -> bool
fn is_after(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval starts after the end of another.
Source§fn is_disjoint_from(&self, other: &impl RangeBounds<T>) -> bool
fn is_disjoint_from(&self, other: &impl RangeBounds<T>) -> bool
Checks if an interval has no overlap with another.
Source§fn intersects(&self, other: &impl RangeBounds<T>) -> bool
fn intersects(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval has some overlap with another.
Source§fn contains_range(&self, other: &impl RangeBounds<T>) -> bool
fn contains_range(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval contains another.
Source§fn is_contained_by(&self, other: &impl RangeBounds<T>) -> bool
fn is_contained_by(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval is contained by another.
Source§fn begins_within(&self, other: &impl RangeBounds<T>) -> bool
fn begins_within(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval starts within another.
Source§fn ends_within(&self, other: &impl RangeBounds<T>) -> bool
fn ends_within(&self, other: &impl RangeBounds<T>) -> bool
Checks if this interval ends within another.