Index

Struct Index 

Source
pub struct Index<T: Bitset>(/* private fields */);
Expand description

Struct allowing to safely index T, where T implements Bitset.

Implementations§

Source§

impl<T> Index<T>
where T: Bitset,

Source

pub const ONE: Self

Value of 1 for Index.
Shortcut from having to use Index::<T>::from_usize(1)

Source

pub const MIN: Self

Minimum value for Index.
Shortcut from having to use Index::<T>::from_usize(usize::MIN)

Source

pub const MAX: Self

Maximum value for Index.
Shortcut from having to use Index::<T>::from_usize(T::BITS - 1)

Source

pub const fn from_usize(value: usize) -> Self

Constructs a valid Index<T> value from usize.

Only use this, if you’re certain, that resulting index will be valid.
Valid inputs to this function are in range 0..(T::BYTE_SIZE * 8). This function exists solely to avoid situations, where you are certain of the validity and don’t want to write:
Index::<T>::try_from_usize(value).expect("value should be in range")

§Panics

This function panics, if the value supplied is outside the range 0..(T::BYTE_SIZE * 8).

§Examples
use bitworks::prelude::{Bitset8, Index, Index8};

let index = Index8::from_usize(7);
assert_eq!(index.into_inner(), 7);
Source

pub const fn try_from_usize(value: usize) -> ConvResult<Self>

Tries constructing an Index<T> value from usize.

Meant to be used in situations, where you’re uncertain, if the value supplied would make a valid Index<T> value.

§Errors

This function errors, if the value supplied is outside the range 0..(T::BYTE_SIZE * 8).

§Examples
use bitworks::prelude::{Bitset8, Index, Index8};

let index = Index8::try_from_usize(7)?;
assert_eq!(index.into_inner(), 7);
Source

pub const fn into_inner(&self) -> usize

Returns value of Index as usize.

§Examples
use bitworks::prelude::{Bitset8, Index, Index8};

let index = Index8::MAX;
assert_eq!(index.into_inner(), 7);
Source

pub const fn checked_add(&self, other: Self) -> Option<Self>

Returns Some Index, that is the sum of self and other, or None on overflow.

§Examples
use bitworks::prelude::{Bitset8, Index, Index8};

let a = Index8::ONE;
let b = Index8::ONE;
let c = a.checked_add(b);
assert_eq!(c.unwrap().into_inner(), 2);

let d = Index8::MAX;
let e = Index8::ONE;
let f = d.checked_add(e);
assert_eq!(f, None);
Source

pub const fn checked_sub(&self, other: Self) -> Option<Self>

Returns Some Index, that is the difference of self and other, or None on overflow.

§Examples
use bitworks::prelude::{Bitset8, Index, Index8};

let a = Index8::MAX;
let b = Index8::ONE;
let c = a.checked_sub(b);
assert_eq!(c.unwrap().into_inner(), 6);

let d = Index8::MIN;
let e = Index8::ONE;
let f = d.checked_sub(e);
assert_eq!(f, None);
Source

pub const fn saturating_add(&self, other: Self) -> Self

Returns Index, that is sum of self and other, or Index::<T>::MAX on overflow.

§Examples
use bitworks::prelude::{Bitset8, Index, Index8};

let a = Index8::ONE;
let b = Index8::ONE;
let c = a.saturating_add(b);
assert_eq!(c.into_inner(), 2);

let d = Index8::MAX;
let e = Index8::ONE;
let f = d.saturating_add(e);
assert_eq!(f.into_inner(), 7);
Source

pub const fn saturating_sub(&self, other: Self) -> Self

Returns Index, that is difference of self and other, or Index::<T>::MIN on overflow.

§Examples
use bitworks::prelude::{Bitset8, Index, Index8};

let a = Index8::MAX;
let b = Index8::ONE;
let c = a.saturating_sub(b);
assert_eq!(c.into_inner(), 6);

let d = Index8::MIN;
let e = Index8::ONE;
let f = d.saturating_sub(e);
assert_eq!(f.into_inner(), 0);
Source

pub fn to_other<U>(self) -> Index<U>
where U: Bitset,

Conversion between indeces.

§Panics

Panics if U::BIT_SIZE is smaller, than T::BIT_SIZE.

§Examples
use bitworks::prelude::{Bitset8, Bitset16, Index, Index8, Index16};

let a16 = Index16::from_usize(7);
let b16 = Index16::from_usize(8);

let a8: Index8 = a16.to_other();
assert_eq!(a8.into_inner(), 7);

// The following will panic!
// let b8: Index8 = b16.to_other();
Source

pub fn to_other_saturating<U>(self) -> Index<U>
where U: Bitset,

Conversion between indeces, with saturation on overflow.

§Examples
use bitworks::prelude::{Bitset8, Bitset16, Index, Index8, Index16};

let a16 = Index16::from_usize(7);
let b16 = Index16::from_usize(8);

let a8: Index8 = a16.to_other_saturating();
assert_eq!(a8.into_inner(), 7);

let b8: Index8 = b16.to_other_saturating();
assert_eq!(b8.into_inner(), 7);
Source

pub fn try_to_other<U>(self) -> ConvResult<Index<U>>
where U: Bitset,

Attempted conversion between BisetIndexes.

§Errors

U::BIT_SIZE is smaller, than T::BIT_SIZE.

§Examples
use bitworks::prelude::{Bitset8, Bitset16, Index, Index8, Index16};

let a16 = Index16::from_usize(7);
let b16 = Index16::from_usize(8);

let a8 = a16.try_to_other::<Bitset8>();
assert_eq!(a8.ok(), Some(Index8::from_usize(7)));

let b8 = b16.try_to_other::<Bitset8>();
assert_eq!(b8.ok(), None);
Source

pub const fn byte_index(self) -> usize

Returns index of byte, where the given index falls into.

This function is useful in cases, where you are working with Bitset as with an array of bytes. As Index is always valid, this function will return a valid index of the byte in the Bitset.

§Examples
use bitworks::prelude::{Bitset8, Bitset16, Index, Index16};

let a = Index16::from_usize(7);
let b = Index16::from_usize(8);

assert_eq!(a.byte_index(), 0); // 7 / 8 = 0
assert_eq!(b.byte_index(), 1); // 8 / 8 = 1
Source

pub const fn bit_index(self) -> usize

Returns index of bit within it’s byte.

This function is useful in cases, where you are working with Bitset as with an array of bytes. As Index is always valid, this function will return a valid index of the bit in it’s byte in the Bitset.

§Examples
use bitworks::prelude::{Bitset8, Bitset16, Index, Index16};

let a = Index16::from_usize(7);
let b = Index16::from_usize(8);

assert_eq!(a.bit_index(), 7); // 7 % 8 = 7
assert_eq!(b.bit_index(), 0); // 8 % 8 = 0
Source

pub const fn bitmask(self) -> u8

Returns a bitmask, with only given index bit set within it’s byte.

This function is useful in cases, where you are working with Bitset as with an array of bytes. As Index is always valid, this function will return a valid bitmask. This function is defined as (1 << Index::bit_index).

§Examples
use bitworks::prelude::{Bitset8, Bitset16, Index, Index16};

let a = Index16::from_usize(7);
let b = Index16::from_usize(8);

assert_eq!(a.bitmask(), 0b10000000); // 1 << 7
assert_eq!(b.bitmask(), 0b00000001); // 1 << 0

Trait Implementations§

Source§

impl BitAnd<Index<Bitset128>> for Bitset128

Source§

type Output = Bitset128

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Index<Bitset128>) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd<Index<Bitset16>> for Bitset16

Source§

type Output = Bitset16

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Index<Bitset16>) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd<Index<Bitset32>> for Bitset32

Source§

type Output = Bitset32

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Index<Bitset32>) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd<Index<Bitset64>> for Bitset64

Source§

type Output = Bitset64

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Index<Bitset64>) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAnd<Index<Bitset8>> for Bitset8

Source§

type Output = Bitset8

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Index<Bitset8>) -> Self::Output

Performs the & operation. Read more
Source§

impl<const N: usize> BitAnd<Index<Byteset<N>>> for Byteset<N>

Source§

type Output = Byteset<N>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Index<Byteset<N>>) -> Self::Output

Performs the & operation. Read more
Source§

impl BitAndAssign<Index<Bitset128>> for Bitset128

Source§

fn bitand_assign(&mut self, rhs: Index<Bitset128>)

Performs the &= operation. Read more
Source§

impl BitAndAssign<Index<Bitset16>> for Bitset16

Source§

fn bitand_assign(&mut self, rhs: Index<Bitset16>)

Performs the &= operation. Read more
Source§

impl BitAndAssign<Index<Bitset32>> for Bitset32

Source§

fn bitand_assign(&mut self, rhs: Index<Bitset32>)

Performs the &= operation. Read more
Source§

impl BitAndAssign<Index<Bitset64>> for Bitset64

Source§

fn bitand_assign(&mut self, rhs: Index<Bitset64>)

Performs the &= operation. Read more
Source§

impl BitAndAssign<Index<Bitset8>> for Bitset8

Source§

fn bitand_assign(&mut self, rhs: Index<Bitset8>)

Performs the &= operation. Read more
Source§

impl<const N: usize> BitAndAssign<Index<Byteset<N>>> for Byteset<N>

Source§

fn bitand_assign(&mut self, rhs: Index<Byteset<N>>)

Performs the &= operation. Read more
Source§

impl BitOr<Index<Bitset128>> for Bitset128

Source§

type Output = Bitset128

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Index<Bitset128>) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<Index<Bitset16>> for Bitset16

Source§

type Output = Bitset16

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Index<Bitset16>) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<Index<Bitset32>> for Bitset32

Source§

type Output = Bitset32

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Index<Bitset32>) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<Index<Bitset64>> for Bitset64

Source§

type Output = Bitset64

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Index<Bitset64>) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOr<Index<Bitset8>> for Bitset8

Source§

type Output = Bitset8

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Index<Bitset8>) -> Self::Output

Performs the | operation. Read more
Source§

impl<const N: usize> BitOr<Index<Byteset<N>>> for Byteset<N>

Source§

type Output = Byteset<N>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Index<Byteset<N>>) -> Self::Output

Performs the | operation. Read more
Source§

impl BitOrAssign<Index<Bitset128>> for Bitset128

Source§

fn bitor_assign(&mut self, rhs: Index<Bitset128>)

Performs the |= operation. Read more
Source§

impl BitOrAssign<Index<Bitset16>> for Bitset16

Source§

fn bitor_assign(&mut self, rhs: Index<Bitset16>)

Performs the |= operation. Read more
Source§

impl BitOrAssign<Index<Bitset32>> for Bitset32

Source§

fn bitor_assign(&mut self, rhs: Index<Bitset32>)

Performs the |= operation. Read more
Source§

impl BitOrAssign<Index<Bitset64>> for Bitset64

Source§

fn bitor_assign(&mut self, rhs: Index<Bitset64>)

Performs the |= operation. Read more
Source§

impl BitOrAssign<Index<Bitset8>> for Bitset8

Source§

fn bitor_assign(&mut self, rhs: Index<Bitset8>)

Performs the |= operation. Read more
Source§

impl<const N: usize> BitOrAssign<Index<Byteset<N>>> for Byteset<N>

Source§

fn bitor_assign(&mut self, rhs: Index<Byteset<N>>)

Performs the |= operation. Read more
Source§

impl BitXor<Index<Bitset128>> for Bitset128

Source§

type Output = Bitset128

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Index<Bitset128>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor<Index<Bitset16>> for Bitset16

Source§

type Output = Bitset16

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Index<Bitset16>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor<Index<Bitset32>> for Bitset32

Source§

type Output = Bitset32

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Index<Bitset32>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor<Index<Bitset64>> for Bitset64

Source§

type Output = Bitset64

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Index<Bitset64>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXor<Index<Bitset8>> for Bitset8

Source§

type Output = Bitset8

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Index<Bitset8>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<const N: usize> BitXor<Index<Byteset<N>>> for Byteset<N>

Source§

type Output = Byteset<N>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Index<Byteset<N>>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl BitXorAssign<Index<Bitset128>> for Bitset128

Source§

fn bitxor_assign(&mut self, rhs: Index<Bitset128>)

Performs the ^= operation. Read more
Source§

impl BitXorAssign<Index<Bitset16>> for Bitset16

Source§

fn bitxor_assign(&mut self, rhs: Index<Bitset16>)

Performs the ^= operation. Read more
Source§

impl BitXorAssign<Index<Bitset32>> for Bitset32

Source§

fn bitxor_assign(&mut self, rhs: Index<Bitset32>)

Performs the ^= operation. Read more
Source§

impl BitXorAssign<Index<Bitset64>> for Bitset64

Source§

fn bitxor_assign(&mut self, rhs: Index<Bitset64>)

Performs the ^= operation. Read more
Source§

impl BitXorAssign<Index<Bitset8>> for Bitset8

Source§

fn bitxor_assign(&mut self, rhs: Index<Bitset8>)

Performs the ^= operation. Read more
Source§

impl<const N: usize> BitXorAssign<Index<Byteset<N>>> for Byteset<N>

Source§

fn bitxor_assign(&mut self, rhs: Index<Byteset<N>>)

Performs the ^= operation. Read more
Source§

impl<T> Clone for Index<T>
where T: Bitset,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for Index<T>
where T: Bitset,

Source§

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

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

impl<T: Default + Bitset> Default for Index<T>

Source§

fn default() -> Index<T>

Returns the “default value” for a type. Read more
Source§

impl From<Index<Bitset128>> for Bitset128

Source§

fn from(value: Index<Bitset128>) -> Self

Converts to this type from the input type.
Source§

impl From<Index<Bitset16>> for Bitset16

Source§

fn from(value: Index<Bitset16>) -> Self

Converts to this type from the input type.
Source§

impl From<Index<Bitset32>> for Bitset32

Source§

fn from(value: Index<Bitset32>) -> Self

Converts to this type from the input type.
Source§

impl From<Index<Bitset64>> for Bitset64

Source§

fn from(value: Index<Bitset64>) -> Self

Converts to this type from the input type.
Source§

impl From<Index<Bitset8>> for Bitset8

Source§

fn from(value: Index<Bitset8>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<Index<Byteset<N>>> for Byteset<N>

Source§

fn from(index: Index<Byteset<N>>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<Index<T>> for usize
where T: Bitset,

Source§

fn from(value: Index<T>) -> Self

Converts to this type from the input type.
Source§

impl<T> Hash for Index<T>
where T: Bitset,

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> Ord for Index<T>
where T: Bitset,

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<T> PartialEq for Index<T>
where T: Bitset,

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> PartialOrd for Index<T>
where T: Bitset,

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Shl<Index<Bitset128>> for Bitset128

Source§

type Output = Bitset128

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Index<Bitset128>) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<Index<Bitset16>> for Bitset16

Source§

type Output = Bitset16

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Index<Bitset16>) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<Index<Bitset32>> for Bitset32

Source§

type Output = Bitset32

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Index<Bitset32>) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<Index<Bitset64>> for Bitset64

Source§

type Output = Bitset64

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Index<Bitset64>) -> Self::Output

Performs the << operation. Read more
Source§

impl Shl<Index<Bitset8>> for Bitset8

Source§

type Output = Bitset8

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Index<Bitset8>) -> Self::Output

Performs the << operation. Read more
Source§

impl<const N: usize> Shl<Index<Byteset<N>>> for Byteset<N>

Source§

type Output = Byteset<N>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Index<Byteset<N>>) -> Self::Output

Performs the << operation. Read more
Source§

impl ShlAssign<Index<Bitset128>> for Bitset128

Source§

fn shl_assign(&mut self, rhs: Index<Bitset128>)

Performs the <<= operation. Read more
Source§

impl ShlAssign<Index<Bitset16>> for Bitset16

Source§

fn shl_assign(&mut self, rhs: Index<Bitset16>)

Performs the <<= operation. Read more
Source§

impl ShlAssign<Index<Bitset32>> for Bitset32

Source§

fn shl_assign(&mut self, rhs: Index<Bitset32>)

Performs the <<= operation. Read more
Source§

impl ShlAssign<Index<Bitset64>> for Bitset64

Source§

fn shl_assign(&mut self, rhs: Index<Bitset64>)

Performs the <<= operation. Read more
Source§

impl ShlAssign<Index<Bitset8>> for Bitset8

Source§

fn shl_assign(&mut self, rhs: Index<Bitset8>)

Performs the <<= operation. Read more
Source§

impl<const N: usize> ShlAssign<Index<Byteset<N>>> for Byteset<N>

Source§

fn shl_assign(&mut self, rhs: Index<Byteset<N>>)

Performs the <<= operation. Read more
Source§

impl Shr<Index<Bitset128>> for Bitset128

Source§

type Output = Bitset128

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Index<Bitset128>) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<Index<Bitset16>> for Bitset16

Source§

type Output = Bitset16

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Index<Bitset16>) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<Index<Bitset32>> for Bitset32

Source§

type Output = Bitset32

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Index<Bitset32>) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<Index<Bitset64>> for Bitset64

Source§

type Output = Bitset64

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Index<Bitset64>) -> Self::Output

Performs the >> operation. Read more
Source§

impl Shr<Index<Bitset8>> for Bitset8

Source§

type Output = Bitset8

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Index<Bitset8>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<const N: usize> Shr<Index<Byteset<N>>> for Byteset<N>

Source§

type Output = Byteset<N>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Index<Byteset<N>>) -> Self::Output

Performs the >> operation. Read more
Source§

impl ShrAssign<Index<Bitset128>> for Bitset128

Source§

fn shr_assign(&mut self, rhs: Index<Bitset128>)

Performs the >>= operation. Read more
Source§

impl ShrAssign<Index<Bitset16>> for Bitset16

Source§

fn shr_assign(&mut self, rhs: Index<Bitset16>)

Performs the >>= operation. Read more
Source§

impl ShrAssign<Index<Bitset32>> for Bitset32

Source§

fn shr_assign(&mut self, rhs: Index<Bitset32>)

Performs the >>= operation. Read more
Source§

impl ShrAssign<Index<Bitset64>> for Bitset64

Source§

fn shr_assign(&mut self, rhs: Index<Bitset64>)

Performs the >>= operation. Read more
Source§

impl ShrAssign<Index<Bitset8>> for Bitset8

Source§

fn shr_assign(&mut self, rhs: Index<Bitset8>)

Performs the >>= operation. Read more
Source§

impl<const N: usize> ShrAssign<Index<Byteset<N>>> for Byteset<N>

Source§

fn shr_assign(&mut self, rhs: Index<Byteset<N>>)

Performs the >>= operation. Read more
Source§

impl<T> TryFrom<usize> for Index<T>
where T: Bitset,

Source§

type Error = ConvError

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

fn try_from(value: usize) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<T> Copy for Index<T>
where T: Bitset,

Source§

impl<T> Eq for Index<T>
where T: Bitset,

Auto Trait Implementations§

§

impl<T> Freeze for Index<T>

§

impl<T> RefUnwindSafe for Index<T>
where T: RefUnwindSafe,

§

impl<T> Send for Index<T>
where T: Send,

§

impl<T> Sync for Index<T>
where T: Sync,

§

impl<T> Unpin for Index<T>
where T: Unpin,

§

impl<T> UnwindSafe for Index<T>
where T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.