pub struct Client { /* private fields */ }
Expand description
A Client instance is an object that can be used to interact with an 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 path.
Sourcepub fn with_read_write(read_write: Box<dyn ReadWrite>) -> Client
pub fn with_read_write(read_write: Box<dyn ReadWrite>) -> Client
Construct 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>>
List 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<()>
Add 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<()>
Remove an identity from the connected ssh-agent.
Sourcepub fn remove_all_identities(&mut self) -> Result<()>
pub fn remove_all_identities(&mut self) -> Result<()>
Remove all identities from the connected ssh-agent.
Auto Trait Implementations§
impl Freeze for Client
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