pub struct ProtectedSecret<'provider, P, State, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,{ /* private fields */ }Expand description
Exact provider-owned protected allocation in one typestate.
Moving this handle may not move the provider’s backing bytes. The type is
!Sync, !UnwindSafe, and !RefUnwindSafe. Those traits communicate API
friction only; cleanup remains correct when callers use AssertUnwindSafe.
Implementations§
Source§impl<'provider, P, Level> ProtectedSecret<'provider, P, Uninitialized, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
impl<'provider, P, Level> ProtectedSecret<'provider, P, Uninitialized, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
Sourcepub fn try_new(
provider: &'provider P,
token: &AssuranceToken<'provider, Level>,
logical_bytes: usize,
) -> Result<Self, ProtectionError>
pub fn try_new( provider: &'provider P, token: &AssuranceToken<'provider, Level>, logical_bytes: usize, ) -> Result<Self, ProtectionError>
Reserves all bounded resources and creates zeroed protected storage.
Source§impl<P, Level> ProtectedSecret<'_, P, Validated, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
impl<P, Level> ProtectedSecret<'_, P, Validated, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
Sourcepub fn expose_secret(&self) -> ExposedProtectedSecret<'_>
pub fn expose_secret(&self) -> ExposedProtectedSecret<'_>
Creates an explicit redacted exposure guard over validated bytes.
Source§impl<'provider, P, State, Level> ProtectedSecret<'provider, P, State, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
impl<'provider, P, State, Level> ProtectedSecret<'provider, P, State, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
Sourcepub const fn initialized_len(&self) -> usize
pub const fn initialized_len(&self) -> usize
Initialized plaintext bytes tracked by this typestate.
Sourcepub fn operation_report(
&self,
token: &AssuranceToken<'provider, Level>,
) -> Result<ProtectedOperationReport, ProtectionError>
pub fn operation_report( &self, token: &AssuranceToken<'provider, Level>, ) -> Result<ProtectedOperationReport, ProtectionError>
Reports posture only for this exact allocation and its recorded operation. Stale tokens fail instead of returning historical assurance.
Sourcepub fn try_close(self) -> Result<CleanupReport, CleanupError>
pub fn try_close(self) -> Result<CleanupReport, CleanupError>
Consumes the public owner and reports the ordered cleanup result.
Trait Implementations§
Source§impl<P, State, Level> Debug for ProtectedSecret<'_, P, State, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
impl<P, State, Level> Debug for ProtectedSecret<'_, P, State, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
Source§impl<P, State, Level> Drop for ProtectedSecret<'_, P, State, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
impl<P, State, Level> Drop for ProtectedSecret<'_, P, State, Level>where
P: ProtectedMemoryProvider,
Level: AssuranceLevel,
impl<P, State, Level> Send for ProtectedSecret<'_, P, State, Level>
Auto Trait Implementations§
impl<'provider, P, State, Level> !RefUnwindSafe for ProtectedSecret<'provider, P, State, Level>
impl<'provider, P, State, Level> !Sync for ProtectedSecret<'provider, P, State, Level>
impl<'provider, P, State, Level> !UnwindSafe for ProtectedSecret<'provider, P, State, Level>
impl<'provider, P, State, Level> Freeze for ProtectedSecret<'provider, P, State, Level>
impl<'provider, P, State, Level> Unpin for ProtectedSecret<'provider, P, State, Level>
impl<'provider, P, State, Level> UnsafeUnpin for ProtectedSecret<'provider, P, State, Level>
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