pub struct SegmentRef<'a, T>where
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> Clone for SegmentRef<'a, T>where
T: Element,
impl<'a, T> Clone for SegmentRef<'a, T>where
T: Element,
Source§fn clone(&self) -> SegmentRef<'a, T>
fn clone(&self) -> SegmentRef<'a, T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, T> Debug for SegmentRef<'a, T>
impl<'a, T> Debug for SegmentRef<'a, T>
Source§impl<'a, T> From<&SegmentRef<'a, T>> for Timingwhere
T: Element,
impl<'a, T> From<&SegmentRef<'a, T>> for Timingwhere
T: Element,
Source§fn from(value: &SegmentRef<'a, T>) -> Timing
fn from(value: &SegmentRef<'a, T>) -> Timing
Converts to this type from the input type.
Source§impl<'a, T> From<SegmentRef<'a, T>> for Timingwhere
T: Element,
impl<'a, T> From<SegmentRef<'a, T>> for Timingwhere
T: Element,
Source§fn from(value: SegmentRef<'a, T>) -> Timing
fn from(value: SegmentRef<'a, T>) -> Timing
Converts to this type from the input type.
Source§impl<'a, T> IntoSegment for SegmentRef<'a, T>
impl<'a, T> IntoSegment for SegmentRef<'a, T>
Source§fn into_segment(self, timing: impl Into<Timing>) -> Segment
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§impl<'a, T> RangeBounds<i32> for SegmentRef<'a, T>where
T: Element,
impl<'a, T> RangeBounds<i32> for SegmentRef<'a, T>where
T: Element,
Source§impl<'a, T> TryFrom<&'a Segment> for SegmentRef<'a, T>where
T: Element,
impl<'a, T> TryFrom<&'a Segment> for SegmentRef<'a, T>where
T: Element,
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &'a Segment,
) -> Result<SegmentRef<'a, T>, <SegmentRef<'a, T> as TryFrom<&'a Segment>>::Error>
fn try_from( value: &'a Segment, ) -> Result<SegmentRef<'a, T>, <SegmentRef<'a, T> as TryFrom<&'a Segment>>::Error>
Performs the conversion.
impl<'a, T> Copy for SegmentRef<'a, T>where
T: Element,
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> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.