pub struct RedactionSession<'policy> { /* private fields */ }Expand description
Carries one immutable policy and one mutable budget through a redaction operation.
Implementations§
Source§impl<'policy> RedactionSession<'policy>
impl<'policy> RedactionSession<'policy>
Sourcepub fn operation(policy: &'policy RedactionPolicy) -> Self
pub fn operation(policy: &'policy RedactionPolicy) -> Self
Creates an ordinary operation session from policy.
Sourcepub fn diagnostic(policy: &'policy RedactionPolicy) -> Self
pub fn diagnostic(policy: &'policy RedactionPolicy) -> Self
Creates a diagnostic session from policy.
Sourcepub const fn policy(&self) -> &'policy RedactionPolicy
pub const fn policy(&self) -> &'policy RedactionPolicy
Returns the immutable policy snapshot used by this session.
Sourcepub const fn kind(&self) -> RedactionSessionKind
pub const fn kind(&self) -> RedactionSessionKind
Returns the kind of operation represented by this session.
Sourcepub fn consume_input(&self, bytes: usize) -> bool
pub fn consume_input(&self, bytes: usize) -> bool
Reserves input bytes in the shared event budget.
Sourcepub fn remaining_input_bytes(&self) -> usize
pub fn remaining_input_bytes(&self) -> usize
Returns the remaining input allowance.
Sourcepub fn remaining_output_bytes(&self) -> usize
pub fn remaining_output_bytes(&self) -> usize
Returns the remaining output allowance.
Sourcepub fn is_exhausted(&self) -> bool
pub fn is_exhausted(&self) -> bool
Returns whether this session is exhausted.
Trait Implementations§
Auto Trait Implementations§
impl<'policy> !Freeze for RedactionSession<'policy>
impl<'policy> !RefUnwindSafe for RedactionSession<'policy>
impl<'policy> !Sync for RedactionSession<'policy>
impl<'policy> Send for RedactionSession<'policy>
impl<'policy> Unpin for RedactionSession<'policy>
impl<'policy> UnsafeUnpin for RedactionSession<'policy>
impl<'policy> UnwindSafe for RedactionSession<'policy>
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