Skip to main content

RedactionSession

Struct RedactionSession 

Source
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>

Source

pub fn operation(policy: &'policy RedactionPolicy) -> Self

Creates an ordinary operation session from policy.

Source

pub fn diagnostic(policy: &'policy RedactionPolicy) -> Self

Creates a diagnostic session from policy.

Source

pub const fn policy(&self) -> &'policy RedactionPolicy

Returns the immutable policy snapshot used by this session.

Source

pub const fn kind(&self) -> RedactionSessionKind

Returns the kind of operation represented by this session.

Source

pub fn consume_input(&self, bytes: usize) -> bool

Reserves input bytes in the shared event budget.

Source

pub fn remaining_input_bytes(&self) -> usize

Returns the remaining input allowance.

Source

pub fn remaining_output_bytes(&self) -> usize

Returns the remaining output allowance.

Source

pub fn is_exhausted(&self) -> bool

Returns whether this session is exhausted.

Trait Implementations§

Source§

impl<'policy> Debug for RedactionSession<'policy>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.