pub struct PreparationStorageGuard<'storage> { /* private fields */ }Expand description
Caller-owned preparation buffers that are cleared together on drop.
A prepared request borrows this guard through Self::prepare, so safe
Rust prevents the guard from being dropped before transport use completes.
Each preparation attempt first volatile-clears both complete borrowed
buffers, including residue from a previous request. Dropping the guard
performs the same complete cleanup.
Implementations§
Source§impl<'storage> PreparationStorageGuard<'storage>
impl<'storage> PreparationStorageGuard<'storage>
Sourcepub const fn new(target: &'storage mut [u8], body: &'storage mut [u8]) -> Self
pub const fn new(target: &'storage mut [u8], body: &'storage mut [u8]) -> Self
Guards two independent caller-owned buffers.
Sourcepub fn for_profile(
target: &'storage mut [u8],
body: &'storage mut [u8],
profile: PreparationCapacityProfile,
) -> Result<Self, PreparationCapacityError>
pub fn for_profile( target: &'storage mut [u8], body: &'storage mut [u8], profile: PreparationCapacityProfile, ) -> Result<Self, PreparationCapacityError>
Guards buffers after validating one named capacity profile.
Sourcepub fn prepare<'guard, O>(
&'guard mut self,
operation: &O,
) -> Result<PreparedRequest<'guard>, O::Error>where
O: PrepareOperation,
pub fn prepare<'guard, O>(
&'guard mut self,
operation: &O,
) -> Result<PreparedRequest<'guard>, O::Error>where
O: PrepareOperation,
Prepares one operation while retaining cleanup ownership.
Both complete buffers are volatile-cleared before each attempt. Reusing one guard therefore does not retain bytes from an earlier request in an unused tail.
Sourcepub fn capacities(&self) -> (usize, usize)
pub fn capacities(&self) -> (usize, usize)
Returns capacities without exposing stored request bytes.