Struct sequoia_ipc::gnupg::Context

source ·
pub struct Context { /* private fields */ }
Expand description

A GnuPG context.

Implementations§

source§

impl Context

source

pub fn new() -> Result<Self>

Creates a new context for the default GnuPG home directory.

source

pub fn with_homedir<P>(homedir: P) -> Result<Self>
where P: AsRef<Path>,

Creates a new context for the given GnuPG home directory.

source

pub fn ephemeral() -> Result<Self>

Creates a new ephemeral context.

The created home directory will be deleted once this object is dropped.

source

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.

source

pub fn socket<C>(&self, socket: C) -> Result<&Path>
where C: AsRef<str>,

Returns the path to a GnuPG socket.

source

pub fn create_socket_dir(&self) -> Result<()>

Creates directories for RPC communication.

source

pub fn remove_socket_dir(&self) -> Result<()>

Removes directories for RPC communication.

Note: This will stop all servers once they note that their socket is gone.

source

pub fn start(&self, component: &str) -> Result<()>

Starts a GnuPG component.

source

pub fn stop(&self, component: &str) -> Result<()>

Stops a GnuPG component.

source

pub fn stop_all(&self) -> Result<()>

Stops all GnuPG components.

Trait Implementations§

source§

impl Debug for Context

source§

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

Formats the value using the given formatter. Read more
source§

impl Drop for Context

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

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> Same for T

§

type Output = T

Should always be Self
source§

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

§

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

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V