Struct openpgp_card::OpenPgp
source · [−]pub struct OpenPgp<'a> { /* private fields */ }
Expand description
An OpenPGP card access object, backed by a CardBackend implementation.
Most users will probably want to use the PcscCard
backend from the openpgp-card-pcsc
crate.
Users of this crate can keep a long lived OpenPgp object. All operations must be performed on
a short lived OpenPgpTransaction
.
Implementations
sourceimpl<'a> OpenPgp<'a>
impl<'a> OpenPgp<'a>
pub fn new(card: &'a mut (dyn CardBackend + Send + Sync)) -> Self
sourcepub fn transaction(&mut self) -> Result<OpenPgpTransaction<'_>, Error>
pub fn transaction(&mut self) -> Result<OpenPgpTransaction<'_>, Error>
Get an OpenPgpTransaction object. This starts a transaction on the underlying CardBackend.
Note: transactions on the Card cannot be long running, they will be reset within seconds when idle.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for OpenPgp<'a>
impl<'a> Send for OpenPgp<'a>
impl<'a> Sync for OpenPgp<'a>
impl<'a> Unpin for OpenPgp<'a>
impl<'a> !UnwindSafe for OpenPgp<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more