[−][src]Struct len_constraints::slice_mut::RelativeMut
A mutable slice with a relative length as length constraint
Note: Unlike the other constrained slices, this type does not validate the constraint on
construction but on deconstruction (self.try_into()
)
Methods
impl<'a, T, Op: Operator, By: TypeNum> RelativeMut<'a, T, Op, By>
[src]
pub fn try_from(
slice: &'a mut [T],
relative_to: usize
) -> Result<Self, Box<dyn Error + 'static>>
[src]
slice: &'a mut [T],
relative_to: usize
) -> Result<Self, Box<dyn Error + 'static>>
Validates slice
against the length constraint and creates the constrained slice with it
pub fn slice(
self,
relative_to: usize
) -> Result<&'a [T], Box<dyn Error + 'static>>
[src]
self,
relative_to: usize
) -> Result<&'a [T], Box<dyn Error + 'static>>
Computes the expected relative length from relative_to
, validates the wrapped slice
against in and returns it on success
pub fn slice_mut(
self,
relative_to: usize
) -> Result<&'a mut [T], Box<dyn Error + 'static>>
[src]
self,
relative_to: usize
) -> Result<&'a mut [T], Box<dyn Error + 'static>>
Computes the expected relative length from relative_to
, validates the wrapped slice
against in and returns it on success
Trait Implementations
impl<'a, T, Op: Operator, By: TypeNum> From<&'a mut [T]> for RelativeMut<'a, T, Op, By>
[src]
fn from(slice: &'a mut [T]) -> Self
[src]
Creates a new relative constrained slice
impl<'a, T: Debug, Op: Debug + Operator, By: Debug + TypeNum> Debug for RelativeMut<'a, T, Op, By>
[src]
Auto Trait Implementations
impl<'a, T, Op, By> Send for RelativeMut<'a, T, Op, By> where
By: Send,
Op: Send,
T: Send,
By: Send,
Op: Send,
T: Send,
impl<'a, T, Op, By> Sync for RelativeMut<'a, T, Op, By> where
By: Sync,
Op: Sync,
T: Sync,
By: Sync,
Op: Sync,
T: Sync,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,