[−][src]Struct xi_rope::interval::Interval
A fancy version of Range
It is an invariant that start <= end
. An interval where end < start
is
considered empty.
Fields
start: usize
end: usize
Methods
impl Interval
[src]
pub fn new(start: usize, end: usize) -> Interval
[src]
Construct a new Interval
representing the range [start..end).
It is an invariant that start <= end
.
pub fn new_closed_open(start: usize, end: usize) -> Interval
[src]
all intervals are now closed_open, use Interval::new
pub fn new_open_closed(start: usize, end: usize) -> Interval
[src]
all intervals are now closed_open
pub fn new_closed_closed(start: usize, end: usize) -> Interval
[src]
all intervals are now closed_open
pub fn new_open_open(start: usize, end: usize) -> Interval
[src]
all intervals are now closed_open
pub fn start(&self) -> usize
[src]
pub fn end(&self) -> usize
[src]
pub fn start_end(&self) -> (usize, usize)
[src]
pub fn is_before(&self, val: usize) -> bool
[src]
the interval is before the point (the point is after the interval)
pub fn contains(&self, val: usize) -> bool
[src]
the point is inside the interval
pub fn is_after(&self, val: usize) -> bool
[src]
the interval is after the point (the point is before the interval)
pub fn is_empty(&self) -> bool
[src]
pub fn intersect(&self, other: Interval) -> Interval
[src]
pub fn union(&self, other: Interval) -> Interval
[src]
pub fn prefix(&self, other: Interval) -> Interval
[src]
pub fn suffix(&self, other: Interval) -> Interval
[src]
pub fn translate(&self, amount: usize) -> Interval
[src]
pub fn translate_neg(&self, amount: usize) -> Interval
[src]
pub fn size(&self) -> usize
[src]
Trait Implementations
impl PartialEq<Interval> for Interval
[src]
impl Copy for Interval
[src]
impl Eq for Interval
[src]
impl From<Range<usize>> for Interval
[src]
impl From<RangeTo<usize>> for Interval
[src]
impl From<RangeInclusive<usize>> for Interval
[src]
fn from(src: RangeInclusive<usize>) -> Interval
[src]
impl From<RangeToInclusive<usize>> for Interval
[src]
fn from(src: RangeToInclusive<usize>) -> Interval
[src]
impl Clone for Interval
[src]
fn clone(&self) -> Interval
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Interval
[src]
impl Display for Interval
[src]
Auto Trait Implementations
impl Send for Interval
impl Unpin for Interval
impl Sync for Interval
impl UnwindSafe for Interval
impl RefUnwindSafe for Interval
Blanket Implementations
impl<T> IntervalBounds for T where
T: Into<Interval>,
[src]
T: Into<Interval>,
fn into_interval(Self, usize) -> Interval
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,