Struct inout::InOutBufReserved

source ·
pub struct InOutBufReserved<'inp, 'out, T> { /* private fields */ }
Expand description

Custom slice type which references one immutable (input) slice and one mutable (output) slice. Input and output slices are either the same or do not overlap. Length of the output slice is always equal or bigger than length of the input slice.

Implementations§

Crate InOutBufReserved from a single mutable slice.

Create InOutBufReserved from raw input and output pointers.

Safety

Behavior is undefined if any of the following conditions are violated:

  • in_ptr must point to a properly initialized value of type T and must be valid for reads for in_len * mem::size_of::<T>() many bytes.
  • out_ptr must point to a properly initialized value of type T and must be valid for both reads and writes for out_len * mem::size_of::<T>() many bytes.
  • in_ptr and out_ptr must be either equal or non-overlapping.
  • If in_ptr and out_ptr are equal, then the memory referenced by them must not be accessed through any other pointer (not derived from the return value) for the duration of lifetime ’a. Both read and write accesses are forbidden.
  • If in_ptr and out_ptr are not equal, then the memory referenced by out_ptr must not be accessed through any other pointer (not derived from the return value) for the duration of lifetime ’a. Both read and write accesses are forbidden. The memory referenced by in_ptr must not be mutated for the duration of lifetime 'a, except inside an UnsafeCell.
  • The total size in_len * mem::size_of::<T>() and out_len * mem::size_of::<T>() must be no larger than isize::MAX.

Get raw input and output pointers.

Get input buffer length.

Get output buffer length.

Crate InOutBufReserved from two separate slices.

Get input slice.

Get output slice.

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self
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.