[][src]Struct yubihsm::connector::usb::Devices

pub struct Devices(_);

A collection of detected YubiHSM 2 devices, represented as Device

Methods

impl Devices[src]

pub fn serial_numbers() -> Result<Vec<SerialNumber>, ConnectionError>[src]

Return the serial numbers of all connected YubiHSM 2s

pub fn open(
    serial_number: Option<SerialNumber>,
    timeout: UsbTimeout
) -> Result<UsbConnection, ConnectionError>
[src]

Open a YubiHSM 2, either selecting one with a particular serial number or opening the only available one if Nonethere is only one connected

pub fn detect(timeout: UsbTimeout) -> Result<Self, ConnectionError>[src]

Detect connected YubiHSM 2s, returning a collection of them

pub fn len(&self) -> usize[src]

Number of detected devices

pub fn is_empty(&self) -> bool[src]

Did we fail to find any YubiHSM 2 devices?

pub fn as_slice(&self) -> &[Device][src]

Borrow the detected devices as a slice

pub fn iter(&self) -> Iter<Device>[src]

Iterate over the detected YubiHSM 2s

Trait Implementations

impl IntoIterator for Devices[src]

type Item = Device

The type of the elements being iterated over.

type IntoIter = IntoIter<Device>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl Send for Devices

impl Sync for Devices

Blanket Implementations

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

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

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

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

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self