Struct ssh_agent_client_rs::Client
source · pub struct Client { /* private fields */ }
Expand description
A Client instance is an object that can be used to interact with a ssh-agent, typically using a Unix socket
Implementations§
source§impl Client
impl Client
sourcepub fn connect(path: &Path) -> Result<Client>
pub fn connect(path: &Path) -> Result<Client>
Constructs a Client connected to a unix socket referenced by the path socket.
sourcepub fn with_read_write(read_write: Box<dyn ReadWrite>) -> Client
pub fn with_read_write(read_write: Box<dyn ReadWrite>) -> Client
Constructs a Client backed by an implementation of ReadWrite, mainly useful for testing.
sourcepub fn list_identities(&mut self) -> Result<Vec<PublicKey>>
pub fn list_identities(&mut self) -> Result<Vec<PublicKey>>
Lists the identities that has been added to the connected ssh-agent.
sourcepub fn add_identity(&mut self, key: &PrivateKey) -> Result<()>
pub fn add_identity(&mut self, key: &PrivateKey) -> Result<()>
Adds an identity to the connected ssh-agent.
sourcepub fn remove_identity(&mut self, key: &PrivateKey) -> Result<()>
pub fn remove_identity(&mut self, key: &PrivateKey) -> Result<()>
Removes an identity from the connected ssh-agent.
sourcepub fn remove_all_identities(&mut self) -> Result<()>
pub fn remove_all_identities(&mut self) -> Result<()>
Removes all identities from the connected ssh-agent.
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl !Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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