Trait CardBackend

Source
pub trait CardBackend {
    // Required methods
    fn limit_card_caps(&self, card_caps: CardCaps) -> CardCaps;
    fn transaction(
        &mut self,
        reselect_application: Option<&[u8]>,
    ) -> Result<Box<dyn CardTransaction + Send + Sync + '_>, SmartcardError>;
}
Expand description

This trait defines a connection with a smart card via a backend implementation (e.g. via the pcsc backend in the crate card-backend-pcsc).

A CardBackend is only used to get access to a CardTransaction object, which supports transmitting commands to the card.

Required Methods§

Source

fn limit_card_caps(&self, card_caps: CardCaps) -> CardCaps

If a CardBackend introduces a additional (possibly backend-specific) limits for any fields in CardCaps, this fn can indicate that limit by returning an amended CardCaps.

Source

fn transaction( &mut self, reselect_application: Option<&[u8]>, ) -> Result<Box<dyn CardTransaction + Send + Sync + '_>, SmartcardError>

Implementors§