For CardBackend and CardTransaction, implement T for Box<T>
- Allow a Box<dyn CardBackend> to be used in all contexts where a type that implements CardBackend can be used. - Likewise for CardTransaction.
This commit is contained in:
parent
ff1dac427c
commit
c4119ae77f
2 changed files with 3 additions and 0 deletions
|
@ -12,6 +12,7 @@ repository = "https://gitlab.com/hkos/openpgp-card"
|
|||
documentation = "https://docs.rs/crate/openpgp-card"
|
||||
|
||||
[dependencies]
|
||||
blanket = "0.2.0"
|
||||
nom = "6"
|
||||
hex-literal = "0.3"
|
||||
hex-slice = "0.1"
|
||||
|
|
|
@ -55,6 +55,7 @@ use crate::tlv::tag::Tag;
|
|||
use crate::tlv::value::Value;
|
||||
use crate::tlv::Tlv;
|
||||
|
||||
#[blanket::blanket(derive(Box))]
|
||||
pub trait CardBackend {
|
||||
fn transaction(
|
||||
&mut self,
|
||||
|
@ -67,6 +68,7 @@ pub trait CardBackend {
|
|||
/// after opening a transaction from a CardBackend.
|
||||
///
|
||||
/// CardTransaction exposes low-level access to OpenPGP card functionality.
|
||||
#[blanket::blanket(derive(Box))]
|
||||
pub trait CardTransaction {
|
||||
/// Transmit the command data in `cmd` to the card.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue