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:
Neal H. Walfield 2022-02-18 17:45:09 +01:00
parent ff1dac427c
commit c4119ae77f
No known key found for this signature in database
GPG key ID: 6863C9AD5B4D22D3
2 changed files with 3 additions and 0 deletions

View file

@ -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"

View file

@ -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.
///