pub struct ExposedEncodedArray<const CAP: usize> { /* private fields */ }Expand description
Owned stack array extracted from EncodedBuffer.
This wrapper keeps the extracted encoded bytes on the crate’s best-effort
drop-time cleanup path. Use
Self::into_exposed_unprotected_array_caller_must_zeroize only when a
bare array is unavoidable and the caller will handle cleanup.
Implementations§
Source§impl<const CAP: usize> ExposedEncodedArray<CAP>
impl<const CAP: usize> ExposedEncodedArray<CAP>
Sourcepub const fn from_array(bytes: [u8; CAP], len: usize) -> Self
pub const fn from_array(bytes: [u8; CAP], len: usize) -> Self
Sourcepub fn into_exposed_unprotected_array_caller_must_zeroize(
self,
) -> ([u8; CAP], usize)
pub fn into_exposed_unprotected_array_caller_must_zeroize( self, ) -> ([u8; CAP], usize)
Consumes the wrapper and returns a bare array plus visible length.
This is an unprotected escape hatch. The returned array will not be cleared by this crate on drop. Callers must clear it with their own approved zeroization policy.
§Security
Treat this as a cleanup-boundary API. Failing to clear the returned array leaves the encoded bytes in ordinary caller-owned memory until overwritten by later stack or heap activity.
Trait Implementations§
Source§impl<const CAP: usize> Debug for ExposedEncodedArray<CAP>
impl<const CAP: usize> Debug for ExposedEncodedArray<CAP>
Source§impl<const CAP: usize> Drop for ExposedEncodedArray<CAP>
impl<const CAP: usize> Drop for ExposedEncodedArray<CAP>
Auto Trait Implementations§
impl<const CAP: usize> Freeze for ExposedEncodedArray<CAP>
impl<const CAP: usize> RefUnwindSafe for ExposedEncodedArray<CAP>
impl<const CAP: usize> Send for ExposedEncodedArray<CAP>
impl<const CAP: usize> Sync for ExposedEncodedArray<CAP>
impl<const CAP: usize> Unpin for ExposedEncodedArray<CAP>
impl<const CAP: usize> UnsafeUnpin for ExposedEncodedArray<CAP>
impl<const CAP: usize> UnwindSafe for ExposedEncodedArray<CAP>
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