Struct pcsc::Context[][src]

pub struct Context { /* fields omitted */ }
Expand description

Library context to the PCSC service.

This structure wraps SCARDCONTEXT.

Implementations

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.

If the Context was cloned, and a clone is still alive, this function will fail with Error::CantDispose.

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).

List all connected card readers, allocating buffers of the required size.

This function wraps SCardListReaders (pcsclite, MSDN). It is an owned version of list_readers, calling list_readers_len to determine the required buffer size.

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

Clone the Context.

Implementation note

This is implemented in the Rust side with an Arc::clone.

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.