pub struct ExposedDecodedArray<const CAP: usize> { /* private fields */ }Expand description
Owned stack array extracted from DecodedBuffer.
This wrapper keeps the extracted decoded 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> ExposedDecodedArray<CAP>
impl<const CAP: usize> ExposedDecodedArray<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 decoded bytes, which may be secret-bearing, in ordinary caller-owned memory until overwritten by later stack or heap activity.
Trait Implementations§
Source§impl<const CAP: usize> Debug for ExposedDecodedArray<CAP>
impl<const CAP: usize> Debug for ExposedDecodedArray<CAP>
Source§impl<const CAP: usize> Drop for ExposedDecodedArray<CAP>
impl<const CAP: usize> Drop for ExposedDecodedArray<CAP>
Auto Trait Implementations§
impl<const CAP: usize> Freeze for ExposedDecodedArray<CAP>
impl<const CAP: usize> RefUnwindSafe for ExposedDecodedArray<CAP>
impl<const CAP: usize> Send for ExposedDecodedArray<CAP>
impl<const CAP: usize> Sync for ExposedDecodedArray<CAP>
impl<const CAP: usize> Unpin for ExposedDecodedArray<CAP>
impl<const CAP: usize> UnsafeUnpin for ExposedDecodedArray<CAP>
impl<const CAP: usize> UnwindSafe for ExposedDecodedArray<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