Device

Struct Device 

Source
pub struct Device {
    pub name: String,
    /* private fields */
}
Expand description

An ICCD smartcard.

This object does not necessarily have a UUID, which is a Trussed/SoloKeys thing.

Fields§

§name: String

Implementations§

Source§

impl Device

Source

pub fn call( &mut self, cla: u8, ins: u8, p1: u8, p2: u8, data: Option<&[u8]>, ) -> Result<Vec<u8>>

Trait Implementations§

Source§

impl Debug for Device

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for Device

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Transport for Device

Source§

fn call(&mut self, instruction: u8, data: &[u8]) -> Result<Vec<u8>>

The minimal higher-level interface to a transport.
Source§

fn call_iso( &mut self, class: u8, instruction: u8, p1: u8, p2: u8, data: &[u8], ) -> Result<Vec<u8>>

Call in the funny ISO 7816 fashion with three extra parameters. Note that only the PCSC transport implements this, not the CTAP transport.
Source§

fn select(&mut self, aid: Vec<u8>) -> Result<()>

Source§

fn instruct(&mut self, instruction: u8) -> Result<Vec<u8>>

Shortcut for when no data is needed.
Source§

impl TryFrom<Device> for Solo2

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(device: Device) -> Result<Solo2>

Performs the conversion.
Source§

impl UuidSelectable for Device

Source§

fn list() -> Vec<Self>

Infallible method listing all usable smartcards.

To find out more about issues along the way, construct the session, list the smartcards, attach them, etc.

Source§

fn try_uuid(&mut self) -> Result<Uuid>

Returns the UUID associated with the thing, if it has a UUID. Read more
Source§

fn having(uuid: Uuid) -> Result<Self, Error>

Returns the thing with the given UUID. Read more

Auto Trait Implementations§

§

impl Freeze for Device

§

impl RefUnwindSafe for Device

§

impl Send for Device

§

impl Sync for Device

§

impl Unpin for Device

§

impl UnwindSafe for Device

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,