pub struct Connector { /* private fields */ }
Expand description
Abstract interface to multiple types of YubiHSM 2 connections
Implementations§
source§impl Connector
impl Connector
sourcepub fn http(config: &HttpConfig) -> Self
Available on crate feature http
only.
pub fn http(config: &HttpConfig) -> Self
http
only.Create a new HTTP connector
sourcepub fn usb(config: &UsbConfig) -> Self
Available on crate feature usb
only.
pub fn usb(config: &UsbConfig) -> Self
usb
only.Create a new USB connector. For more advanced usage including connecting to multiple YubiHSMs over USB which are plugged into the same computer, please see the yubihsm::connector::usb module.
sourcepub fn mockhsm() -> Self
Available on crate feature mockhsm
only.
pub fn mockhsm() -> Self
mockhsm
only.Create a mock HSM connector (useful for testing)
sourcepub fn send_message(&self, uuid: Uuid, msg: Message) -> Result<Message, Error>
pub fn send_message(&self, uuid: Uuid, msg: Message) -> Result<Message, Error>
Send a command message to the HSM, then read and return the response
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Connector
impl Send for Connector
impl Sync for Connector
impl Unpin for Connector
impl !UnwindSafe for Connector
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more