Struct hash_arr_map::Idx[][src]

pub struct Idx<T: ?Sized> { /* fields omitted */ }
Expand description

A value represented as an index.

Valid indices

Valid indices are defined by the type T. In order for an index to be valid, they must be valid to be passed into FromIndex::from_index.

Created by either IntoIndex::into_index or Idx::try_new.

Implementations

Create a new index with the specified value if the type allows it.

Create a new index with the specific value.

Safety

The value must be a valid index.

Same as Self::new, except that v can be zero, and None will be returned.

Safety

The value must either be a valid index or zero.

This reinterprets the index as a different type of index; essentially Idx::<U>::new(self.get()).

Safety

The index must be a valid index for type U.

This reinterprets the index as a different type of index; essentially Idx::<U>::new(self.get()).

This is restricted by Borrow, meaning that it is type-safe.

Convert this index into a value.

A shorthand for <T as FromIndex>::from_index(self).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.