Trait ExposeProtected

Source
pub trait ExposeProtected {
    type Target: ?Sized;

    // Required methods
    fn expose_read<F>(&self, f: F)
       where F: FnOnce(SecureRef<&Self::Target>);
    fn expose_write<F>(&mut self, f: F)
       where F: FnOnce(SecureRef<&mut Self::Target>);
    fn unprotect(self) -> SecureBox<Self::Target>;
}
Expand description

Access a protected value for reading or writing.

While the value is being accessed, the protections offered by the container (including memory protections and/or encryption) will be inactive.

Required Associated Types§

Source

type Target: ?Sized

The type of the referenced value.

Required Methods§

Source

fn expose_read<F>(&self, f: F)
where F: FnOnce(SecureRef<&Self::Target>),

Expose the protected value for reading.

Source

fn expose_write<F>(&mut self, f: F)
where F: FnOnce(SecureRef<&mut Self::Target>),

Expose the protected value for updating.

Source

fn unprotect(self) -> SecureBox<Self::Target>

Unwrap the protected value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§