pub struct Context { /* private fields */ }
Expand description
Generic context.
Implementations§
Trait Implementations§
Source§impl IsContext for Context
impl IsContext for Context
Source§fn encrypt(
&mut self,
recipients: &Recipients,
plaintext: Plaintext,
) -> Result<Ciphertext>
fn encrypt( &mut self, recipients: &Recipients, plaintext: Plaintext, ) -> Result<Ciphertext>
Encrypt plaintext for recipients.
Source§fn can_decrypt(&mut self, ciphertext: Ciphertext) -> Result<bool>
fn can_decrypt(&mut self, ciphertext: Ciphertext) -> Result<bool>
Check whether we can decrypt ciphertext.
Source§fn import_key(&mut self, key: &[u8]) -> Result<()>
fn import_key(&mut self, key: &[u8]) -> Result<()>
Import the given key from bytes into keychain.
Source§fn export_key(&mut self, key: Key) -> Result<Vec<u8>>
fn export_key(&mut self, key: Key) -> Result<Vec<u8>>
Export the given key from the keychain as bytes.
Source§fn supports_proto(&self, proto: Proto) -> bool
fn supports_proto(&self, proto: Proto) -> bool
Check whether this context supports the given protocol.
Source§fn encrypt_file(
&mut self,
recipients: &Recipients,
plaintext: Plaintext,
path: &Path,
) -> Result<()>
fn encrypt_file( &mut self, recipients: &Recipients, plaintext: Plaintext, path: &Path, ) -> Result<()>
Encrypt plaintext and write it to the file.
Source§fn can_decrypt_file(&mut self, path: &Path) -> Result<bool>
fn can_decrypt_file(&mut self, path: &Path) -> Result<bool>
Check whether we can decrypt ciphertext from file.
Source§fn get_public_key(&mut self, fingerprint: &str) -> Result<Key>
fn get_public_key(&mut self, fingerprint: &str) -> Result<Key>
Obtain a public key from keychain for fingerprint.
Source§fn find_public_keys(&mut self, fingerprints: &[&str]) -> Result<Vec<Key>>
fn find_public_keys(&mut self, fingerprints: &[&str]) -> Result<Vec<Key>>
Find public keys from keychain for fingerprints. Read more
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more