pub struct Context { /* private fields */ }Expand description
A GnuPG context.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Creates a new context for the default GnuPG home directory.
Sourcepub fn with_homedir<P>(homedir: P) -> Result<Self, Error>
pub fn with_homedir<P>(homedir: P) -> Result<Self, Error>
Creates a new context for the given GnuPG home directory.
Sourcepub fn ephemeral() -> Result<Self, Error>
pub fn ephemeral() -> Result<Self, Error>
Creates a new ephemeral context.
The created home directory will be deleted once this object is dropped.
Sourcepub fn homedir(&self) -> Option<&Path>
pub fn homedir(&self) -> Option<&Path>
Returns the path to homedir directory.
The path returned will be in a local format, i. e. one accepted by
available gpgconf or gpg tools.
Sourcepub fn create_socket_dir(&self) -> Result<(), Error>
pub fn create_socket_dir(&self) -> Result<(), Error>
Creates directories for RPC communication.
Sourcepub fn remove_socket_dir(&self) -> Result<(), Error>
pub fn remove_socket_dir(&self) -> Result<(), Error>
Removes directories for RPC communication.
Note: This will stop all servers once they note that their socket is gone.
Trait Implementations§
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<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