Struct pcsc::Context [] [src]

pub struct Context { /* fields omitted */ }

Library context to the PCSC service.

This structure wraps SCARDCONTEXT.

Methods

impl Context
[src]

Establish a new context.

This function wraps SCardEstablishContext (pcsclite, MSDN).

Release the context.

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

This function wraps SCardReleaseContext (pcsclite, MSDN).

Note

Context implements Drop which automatically releases the context; you only need to call this function if you want to handle errors.

Check whether the Context is still valid.

This function wraps SCardIsValidContext (pcsclite, MSDN).

Cancel any ongoing blocking operation in the Context.

See the cancel.rs example program.

This function wraps SCardCancel (pcsclite, MSDN).

List all connected card readers.

buffer is a buffer that should be large enough to hold all of the connected reader names. The function list_readers_len can be used to find the exact required length.

Returns an iterator over the reader names. The iterator yields values directly from buffer.

If the buffer is not large enough to hold all of the names, Error::InsufficientBuffer is returned.

This function wraps SCardListReaders (pcsclite, MSDN).

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

This function wraps SCardListReaders (pcsclite, MSDN).

Connect to a card which is present in a reader.

See the connect.rs example program.

This function wraps SCardConnect (pcsclite, MSDN).

Wait for card and card reader state changes.

The function blocks until the state of one of the readers changes from corresponding passed-in ReaderState. The ReaderStates are updated to report the new state.

A special reader name, \\?PnP?\Notification, can be used to detect card reader insertions and removals, as opposed to state changes of a specific reader. Use PNP_NOTIFICATION() to easily obtain a static reference to this name.

See the monitor.rs example program.

This function wraps SCardGetStatusChange (pcsclite, MSDN).

Trait Implementations

impl Drop for Context
[src]

A method called when the value goes out of scope. Read more

impl Send for Context
[src]

impl Sync for Context
[src]