Skip to main content

RangeBoundsSpecImpl

Trait RangeBoundsSpecImpl 

Source
pub trait RangeBoundsSpecImpl<T: ?Sized>: RangeBounds<T> {
    // Required methods
    exec fn spec_start_bound(&self) -> SpecBound<&T>;
    exec fn spec_end_bound(&self) -> SpecBound<&T>;
}

Required Methods§

Source

exec fn spec_start_bound(&self) -> SpecBound<&T>

Source

exec fn spec_end_bound(&self) -> SpecBound<&T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a, T: ?Sized + 'a> RangeBoundsSpecImpl<T> for (Bound<&'a T>, Bound<&'a T>)

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{
    match self.0 {
        Bound::Included(start) => SpecBound::Included(start),
        Bound::Excluded(start) => SpecBound::Excluded(start),
        Bound::Unbounded => SpecBound::Unbounded,
    }
}
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{
    match self.1 {
        Bound::Included(end) => SpecBound::Included(end),
        Bound::Excluded(end) => SpecBound::Excluded(end),
        Bound::Unbounded => SpecBound::Unbounded,
    }
}
Source§

impl<T> RangeBoundsSpecImpl<T> for (Bound<T>, Bound<T>)

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ spec_bound_ref(&self.0) }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ spec_bound_ref(&self.1) }
Source§

impl<T> RangeBoundsSpecImpl<T> for Range<&T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(self.start) }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Excluded(self.end) }
Source§

impl<T> RangeBoundsSpecImpl<T> for Range<T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(&self.start) }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Excluded(&self.end) }
Source§

impl<T> RangeBoundsSpecImpl<T> for RangeFrom<&T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(self.start) }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Unbounded }
Source§

impl<T> RangeBoundsSpecImpl<T> for RangeFrom<T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(&self.start) }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Unbounded }
Source§

impl<T> RangeBoundsSpecImpl<T> for RangeInclusive<&T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(self@.start) }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(self@.end) }
Source§

impl<T> RangeBoundsSpecImpl<T> for RangeInclusive<T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(&self@.start) }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(&self@.end) }
Source§

impl<T> RangeBoundsSpecImpl<T> for RangeTo<&T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Unbounded }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Excluded(self.end) }
Source§

impl<T> RangeBoundsSpecImpl<T> for RangeTo<T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Unbounded }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Excluded(&self.end) }
Source§

impl<T> RangeBoundsSpecImpl<T> for RangeToInclusive<&T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Unbounded }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(self.end) }
Source§

impl<T> RangeBoundsSpecImpl<T> for RangeToInclusive<T>

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Unbounded }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Included(&self.end) }
Source§

impl<T: ?Sized> RangeBoundsSpecImpl<T> for RangeFull

Source§

open spec fn spec_start_bound(&self) -> SpecBound<&T>

{ SpecBound::Unbounded }
Source§

open spec fn spec_end_bound(&self) -> SpecBound<&T>

{ SpecBound::Unbounded }

Implementors§