logo

Struct inout::InOut

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

Custom pointer type which contains one immutable (input) and one mutable (output) pointer, which are either equal or non-overlapping.

Implementations

Reborrow self.

Get immutable reference to the input value.

Get mutable reference to the output value.

Convert self to a pair of raw input and output pointers.

Create InOut 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.
  • out_ptr must point to a properly initialized value of type T and must be valid for both reads and writes.
  • 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.

Clone input value and return it.

Returns InOut for the given position.

Panics

If pos greater or equal to array length.

Convert InOut array to InOutBuf.

XOR data with values behind the input slice and write result to the output slice.

Panics

If data length is not equal to the buffer length.

XOR data with values behind the input slice and write result to the output slice.

Panics

If data length is not equal to the buffer length.

Trait Implementations

Converts to this type from the input type.

Converts to this type from the input type.

The type returned in the event of a conversion error.

Performs the conversion.

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.