-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pcsc: Allow a transaction to own the underlying card.
- Since Rust's support for self-referencial data structures is weak, there are cases where it is useful for a transaction to own the card and not just for it to hold a mutable reference. In these cases, the caller needs to explicitly end the transaction to recover the underlying card, but that is acceptable. - Generalize `Transaction` to be generic over a `BorrowMut<Card>`. Add new functions `Card::begin_transaction_owned` and `Card::begin_transaction2_owned` to create this type of transaction. Change `Transaction::end` to return the underlying card. And, add a variant, `Transaction::end2`, to unconditionally return the underlying card independent of whether ending the transaction succeeded. - Fixes #28.
- Loading branch information
Showing
1 changed file
with
106 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters