pub struct SegmentRef<'a, T: Element> {
    pub element: &'a T,
    pub timing: &'a Timing,
    pub name: &'a Option<String>,
}
Expand description

A typed view of a Segment (references to its fields).

Fields§

§element: &'a T

The element reference.

§timing: &'a Timing

The segment’s timing reference.

§name: &'a Option<String>

The segment’s name reference.

Trait Implementations§

source§

impl<'a, T: Element> Clone for SegmentRef<'a, T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, T: Debug + Element> Debug for SegmentRef<'a, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, T> IntoSegment for SegmentRef<'a, T>
where T: Element + Clone,

source§

fn into_segment(self, timing: impl Into<Timing>) -> Segment

Turns this SegmentRef into a new Segment with a given timing.

Note: This also copies the name if it exists. If this is not desired, use:

let segment = segment_ref.into_segment(timing).unnamed();
source§

fn over(self, timing: impl Into<Timing>) -> Segment

Creates a Segment from this element, spanning the given time range.
source§

impl<'a, T: Element> RangeBounds<i32> for SegmentRef<'a, T>

source§

fn start_bound(&self) -> Bound<&i32>

Start index bound. Read more
source§

fn end_bound(&self) -> Bound<&i32>

End index bound. Read more
1.35.0 · source§

fn contains<U>(&self, item: &U) -> bool
where T: PartialOrd<U>, U: PartialOrd<T> + ?Sized,

Returns true if item is contained in the range. Read more
source§

impl<'a, T: Element> TryFrom<&'a Segment> for SegmentRef<'a, T>

§

type Error = ConversionError

The type returned in the event of a conversion error.
source§

fn try_from(value: &'a Segment) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a, T: Element> Copy for SegmentRef<'a, T>

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for SegmentRef<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for SegmentRef<'a, T>
where T: Sync,

§

impl<'a, T> Sync for SegmentRef<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for SegmentRef<'a, T>

§

impl<'a, T> UnwindSafe for SegmentRef<'a, T>
where T: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, R> RangeOps<T> for R
where T: PartialOrd, R: RangeBounds<T>,

source§

fn is_empty(&self) -> bool

Checks if an interval is empty.
source§

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

Checks if this interval starts after the end of another.
source§

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

Checks if this interval has some overlap with another.
source§

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

Checks if this interval is contained by another.
source§

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

Checks if this interval ends within another.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V