pub struct InOutBuf<'inp, 'out, T> { /* private fields */ }Expand description
A lightweight I/O buffer abstraction without depending on the RustCrypto inout crate.
Implementations§
Source§impl<'inp, 'out, T> InOutBuf<'inp, 'out, T>
impl<'inp, 'out, T> InOutBuf<'inp, 'out, T>
Sourcepub fn new(
in_buf: &'inp [T],
out_buf: &'out mut [T],
) -> Result<Self, NotEqualError>
pub fn new( in_buf: &'inp [T], out_buf: &'out mut [T], ) -> Result<Self, NotEqualError>
Create an in/out buffer from separate input and output slices.
Sourcepub unsafe fn from_raw(in_ptr: *const T, out_ptr: *mut T, len: usize) -> Self
pub unsafe fn from_raw(in_ptr: *const T, out_ptr: *mut T, len: usize) -> Self
Construct from raw pointers.
Sourcepub fn into_out(self) -> &'out mut [T]
pub fn into_out(self) -> &'out mut [T]
Return the output slice while preserving the caller’s write access.
Sourcepub fn into_out_with_copied_in(self) -> &'out mut [T]where
T: Copy,
pub fn into_out_with_copied_in(self) -> &'out mut [T]where
T: Copy,
Return the output slice, copying input into output when the regions differ.
Trait Implementations§
Auto Trait Implementations§
impl<'inp, 'out, T> !Send for InOutBuf<'inp, 'out, T>
impl<'inp, 'out, T> !Sync for InOutBuf<'inp, 'out, T>
impl<'inp, 'out, T> !UnwindSafe for InOutBuf<'inp, 'out, T>
impl<'inp, 'out, T> Freeze for InOutBuf<'inp, 'out, T>
impl<'inp, 'out, T> RefUnwindSafe for InOutBuf<'inp, 'out, T>where
*const T: RefUnwindSafe,
*mut T: RefUnwindSafe,
PhantomData<(&'inp T, &'out mut T)>: RefUnwindSafe,
impl<'inp, 'out, T> Unpin for InOutBuf<'inp, 'out, T>
impl<'inp, 'out, T> UnsafeUnpin for InOutBuf<'inp, 'out, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more