Struct IndexBounds

Source
pub struct IndexBounds {
    pub start: Option<usize>,
    pub end: Option<usize>,
}
Expand description

Defines which number of arguments is valid.

Convertible from an exact value a as well as inclusive range expressions a.., ..=b, a..=b.

Fields§

§start: Option<usize>

The lower (inclusive) bound of the expected number of arguments, or None if unbounded.

§end: Option<usize>

The upper (inclusive) bound of the expected number of arguments, or None if unbounded.

Implementations§

Source§

impl IndexBounds

Source

pub fn contains(&self, value: usize) -> bool

Trait Implementations§

Source§

impl Debug for IndexBounds

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for IndexBounds

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<RangeFrom<usize>> for IndexBounds

a..

Source§

fn from(range: RangeFrom<usize>) -> Self

Converts to this type from the input type.
Source§

impl From<RangeInclusive<usize>> for IndexBounds

a..=b

Source§

fn from(range: RangeInclusive<usize>) -> Self

Converts to this type from the input type.
Source§

impl From<RangeToInclusive<usize>> for IndexBounds

..=b

Source§

fn from(range: RangeToInclusive<usize>) -> Self

Converts to this type from the input type.
Source§

impl From<usize> for IndexBounds

a

Source§

fn from(exact_value: usize) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.