pub struct Mrs<T> { /* private fields */ }Expand description
Mrs Minimal Range Span
In a nut shell this is the minimal struct to represent a range for crate. Requires that GetBeginEnd and std::ops::RangeBounds be imported to use all implemented traits.
use common_range_tools::{
Mrs,
GetBeginEnd // only required for the self.get_begin() and self.get_end() methods.
};
use std::ops::{RangeBounds,Bound};
fn main () {
let r=Mrs::new(1,2);
assert_eq!(r.start_bound(),Bound::Included(&1));
assert_eq!(r.end_bound(),Bound::Included(&2));
assert_eq!(r.get_begin(),&1);
assert_eq!(r.get_end(),&2);
}
Implementations§
Trait Implementations§
Source§impl<T> From<Mrs<T>> for RangeInclusive<T>
impl<T> From<Mrs<T>> for RangeInclusive<T>
Source§impl<T> From<RangeInclusive<T>> for Mrs<T>
impl<T> From<RangeInclusive<T>> for Mrs<T>
Source§fn from(value: RangeInclusive<T>) -> Self
fn from(value: RangeInclusive<T>) -> Self
Converts to this type from the input type.
Source§impl<T> GetBeginEnd<T> for Mrs<T>
impl<T> GetBeginEnd<T> for Mrs<T>
Source§impl<T> GetBeginEndOption<T, Mrs<T>> for MrsFactory<T>
impl<T> GetBeginEndOption<T, Mrs<T>> for MrsFactory<T>
Source§impl<T> RangeBounds<T> for Mrs<T>
impl<T> RangeBounds<T> for Mrs<T>
Source§fn start_bound(&self) -> Bound<&T>
fn start_bound(&self) -> Bound<&T>
Wraps the return value from self.get_begin() in a std::ops::Bound::Included.
Source§fn end_bound(&self) -> Bound<&T>
fn end_bound(&self) -> Bound<&T>
Wraps the return value from self.get_end() in a std::ops::Bound::Included.
Auto Trait Implementations§
impl<T> Freeze for Mrs<T>where
T: Freeze,
impl<T> RefUnwindSafe for Mrs<T>where
T: RefUnwindSafe,
impl<T> Send for Mrs<T>where
T: Send,
impl<T> Sync for Mrs<T>where
T: Sync,
impl<T> Unpin for Mrs<T>where
T: Unpin,
impl<T> UnsafeUnpin for Mrs<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Mrs<T>where
T: UnwindSafe,
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