[−][src]Struct solana_libra_proptest_helpers::Index
Wrapper for proptest
's Index
that allows AsRef
to work.
There is no blanket impl<T> AsRef<T> for T
, so &[PropIndex]
doesn't work with
&[impl AsRef<PropIndex>]
(unless an impl gets added upstream). Index
does.
Methods from Deref<Target = PropIndex>
pub fn index(&self, size: usize) -> usize
[src]
Return the real index that would be used to index a collection of size size
.
Panics
Panics if size == 0
.
pub fn get<T>(&self, slice: &'a [T]) -> &'a T
[src]
Return a reference to the element in slice
that this Index
refers to.
A shortcut for &slice[index.index(slice.len())]
.
pub fn get_mut<T>(&self, slice: &'a mut [T]) -> &'a mut T
[src]
Return a mutable reference to the element in slice
that this Index
refers to.
A shortcut for &mut slice[index.index(slice.len())]
.
Trait Implementations
impl Arbitrary for Index
[src]
type Parameters = <PropIndex as Arbitrary>::Parameters
The type of parameters that [arbitrary_with
] accepts for configuration of the generated [Strategy
]. Parameters must implement [Default
]. Read more
type Strategy = Map<(<PropIndex as Arbitrary>::Strategy,), fn(_: (PropIndex,)) -> Self>
The type of [Strategy
] used to generate values of type Self
. Read more
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
[src]
fn arbitrary() -> Self::Strategy
[src]
impl AsRef<Index> for Index
[src]
impl Clone for Index
[src]
impl Copy for Index
[src]
impl Debug for Index
[src]
impl Deref for Index
[src]
Auto Trait Implementations
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,