pub struct Backend { /* private fields */ }Implementations§
Source§impl Backend
impl Backend
Sourcepub async fn init<P: AsRef<Path>>(home: P, default: bool) -> Result<Self>
pub async fn init<P: AsRef<Path>>(home: P, default: bool) -> Result<Self>
Initializes an openpgp card backend.
home is the directory where the backend will look for its
configuration, e.g., $HOME/.sq/keystore/openpgp-card.
If default is true, this backend uses the cards managed by
PCSC. Otherwise, the backend is disabled.
Sourcepub async fn init_ephemeral() -> Result<Self>
pub async fn init_ephemeral() -> Result<Self>
Initializes an ephemeral OpenPGP card backend.
This is primarily useful for testing.
Trait Implementations§
Source§impl Backend for Backend
impl Backend for Backend
Source§fn scan<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn scan<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Causes the backend to look for devices. Read more
Source§fn list<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = Box<dyn DeviceHandle + Send + Sync + 'a>> + Send + Sync + 'a>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn list<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Box<dyn Iterator<Item = Box<dyn DeviceHandle + Send + Sync + 'a>> + Send + Sync + 'a>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Lists all devices that are available or registered. Read more
Source§fn find_device<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn DeviceHandle + Send + Sync + 'a>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_device<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn DeviceHandle + Send + Sync + 'a>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a handle for the specified device. Read more
Source§fn find_key<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn KeyHandle + Send + Sync + 'a>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_key<'a, 'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn KeyHandle + Send + Sync + 'a>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a handle for the specified key. Read more
Auto Trait Implementations§
impl Freeze for Backend
impl !RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl !UnwindSafe for Backend
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