Struct pcsc::Transaction [] [src]

pub struct Transaction<'tx, 'card: 'tx> { /* fields omitted */ }

An exclusive transaction with a card.

A transaction ensures uninterrupted access to the card for its duration. All other operations performed on the same underlying card (even from other processes) will block until the transaction is finished.

Methods

impl<'tx, 'card: 'tx> Transaction<'tx, 'card>
[src]

[src]

End the transaction.

In case of error, ownership of the transaction is returned to the caller.

This function wraps SCardEndTransaction (pcsclite, MSDN).

Note

Transaction implements Drop which automatically ends the transaction using Disposition::LeaveCard; you only need to call this function if you want to handle errors or use a different disposition method.

Methods from Deref<Target = Card<'card>>

[src]

Disconnect from the card.

In case of error, ownership of the card is returned to the caller.

This function wraps SCardDisconnect (pcsclite, MSDN).

Note

Card implements Drop which automatically disconnects the card using Disposition::ResetCard; you only need to call this function if you want to handle errors or use a different disposition method.

[src]

Get current info on the card.

This function wraps SCardStatus (pcsclite, MSDN).

[src]

Get an attribute of the card or card reader.

buffer is a buffer that should be large enough for the attribute data. The function get_attribute_len can be used to find the exact required length.

Returns a slice into buffer containing the attribute data.

If the buffer is not large enough, Error::InsufficientBuffer is returned.

This function wraps SCardGetAttrib (pcsclite, MSDN).

[src]

Get the needed length of a buffer to be passed to get_attribute.

This function wraps SCardGetAttrib (pcsclite, MSDN).

[src]

Set an attribute of the card or card reader.

This function wraps SCardSetAttrib (pcsclite, MSDN).

[src]

Transmit an APDU command to the card.

receive_buffer is a buffer that should be large enough to hold the APDU response.

Returns a slice into receive_buffer containing the APDU response.

If receive_buffer is not large enough to hold the APDU response, Error::InsufficientBuffer is returned.

This function wraps SCardTransmit (pcsclite, MSDN).

[src]

Sends a command directly to the reader (driver).

receive_buffer is a buffer that should be large enough to hold the response.

Returns a slice into receive_buffer containing the response.

If receive_buffer is not large enough to hold the response, Error::InsufficientBuffer is returned.

This function wraps SCardControl (pcsclite, MSDN).

Trait Implementations

impl<'tx, 'card: 'tx> Drop for Transaction<'tx, 'card>
[src]

[src]

Executes the destructor for this type. Read more

impl<'tx, 'card: 'tx> Deref for Transaction<'tx, 'card>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.