Skip to main content

GetBeginEnd

Trait GetBeginEnd 

Source
pub trait GetBeginEnd<T> {
    // Required methods
    fn get_begin(&self) -> &T;
    fn get_end(&self) -> &T;
    fn to_tuple(self) -> (T, T);

    // Provided method
    fn to_tuple_ref(&self) -> (&T, &T) { ... }
}
Expand description

Trait used by internals to represent ranges.

Required Methods§

Source

fn get_begin(&self) -> &T

Should return a borrowed instance of the begin value.

Source

fn get_end(&self) -> &T

Should return a borrowed instance of the end value.

Source

fn to_tuple(self) -> (T, T)

Provided Methods§

Source

fn to_tuple_ref(&self) -> (&T, &T)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> GetBeginEnd<T> for RangeInclusive<T>

Source§

fn get_begin(&self) -> &T

Source§

fn get_end(&self) -> &T

Source§

fn to_tuple(self) -> (T, T)

Implementors§

Source§

impl<'r, T, R: GetBeginEnd<T>> GetBeginEnd<T> for MrsP<'r, T, R>

Source§

impl<T, R: GetBeginEnd<T>, S: RangeBounds<T>> GetBeginEnd<T> for ConsolidateMrsP<T, R, S>

Source§

impl<T> GetBeginEnd<T> for Mrs<T>