[−][src]Struct pcsc::Transaction
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> Transaction<'tx>
[src]
pub fn end(
self,
disposition: Disposition
) -> Result<(), (Transaction<'tx>, Error)>
[src]
self,
disposition: Disposition
) -> Result<(), (Transaction<'tx>, Error)>
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>
pub fn status(&self) -> Result<(Status, Protocol), Error>
[src]
pub fn get_attribute<'buf>(
&self,
attribute: Attribute,
buffer: &'buf mut [u8]
) -> Result<&'buf [u8], Error>
[src]
&self,
attribute: Attribute,
buffer: &'buf mut [u8]
) -> Result<&'buf [u8], Error>
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.
pub fn get_attribute_len(&self, attribute: Attribute) -> Result<usize, Error>
[src]
Get the needed length of a buffer to be passed to get_attribute
.
pub fn set_attribute(
&self,
attribute: Attribute,
attribute_data: &[u8]
) -> Result<(), Error>
[src]
&self,
attribute: Attribute,
attribute_data: &[u8]
) -> Result<(), Error>
pub fn transmit<'buf>(
&self,
send_buffer: &[u8],
receive_buffer: &'buf mut [u8]
) -> Result<&'buf [u8], Error>
[src]
&self,
send_buffer: &[u8],
receive_buffer: &'buf mut [u8]
) -> Result<&'buf [u8], Error>
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.
pub fn control<'buf>(
&self,
control_code: DWORD,
send_buffer: &[u8],
receive_buffer: &'buf mut [u8]
) -> Result<&'buf [u8], Error>
[src]
&self,
control_code: DWORD,
send_buffer: &[u8],
receive_buffer: &'buf mut [u8]
) -> Result<&'buf [u8], Error>
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.
Trait Implementations
impl<'tx> Drop for Transaction<'tx>
[src]
impl<'tx> Deref for Transaction<'tx>
[src]
Auto Trait Implementations
impl<'tx> Send for Transaction<'tx>
impl<'tx> Sync for Transaction<'tx>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,