Struct SegmentRef

Source
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: Element> From<&SegmentRef<'a, T>> for Range<i32>

Source§

fn from(value: &SegmentRef<'a, T>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T: Element> From<&SegmentRef<'a, T>> for Timing

Source§

fn from(value: &SegmentRef<'a, T>) -> Self

Converts to this type from the input type.
Source§

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

Source§

fn from(value: SegmentRef<'a, T>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T: Element> From<SegmentRef<'a, T>> for Timing

Source§

fn from(value: SegmentRef<'a, T>) -> Self

Converts to this type from the input type.
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§

fn is_empty(&self) -> bool
where T: PartialOrd,

🔬This is a nightly-only experimental API. (range_bounds_is_empty)
Returns true if the range contains no items. One-sided ranges (RangeFrom, etc) always return false. Read more
Source§

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

Source§

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> Freeze for SegmentRef<'a, T>

§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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