RangeValue

Trait RangeValue 

Source
pub trait RangeValue<T: Copy + PartialOrd<T> = usize>: Sized {
    // Required method
    fn as_range(&self) -> Range<T>;

    // Provided methods
    fn cmp(&self, val: T) -> Ordering { ... }
    fn contains(&self, v: T) -> bool { ... }
    fn binary_search<'a, S: AsRef<[Self]> + 'a>(
        s: &'a S,
        val: T,
    ) -> Option<&'a Self> { ... }
    fn binary_search_mut<'a, S: AsMut<[Self]> + 'a>(
        s: &'a mut S,
        val: T,
    ) -> Option<&'a mut Self> { ... }
}

Required Methods§

Source

fn as_range(&self) -> Range<T>

Provided Methods§

Source

fn cmp(&self, val: T) -> Ordering

Source

fn contains(&self, v: T) -> bool

Source

fn binary_search_mut<'a, S: AsMut<[Self]> + 'a>( s: &'a mut S, val: T, ) -> Option<&'a mut Self>

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 RangeValue for SectionTable

Implementors§