diff options
author | Alex Crichton <alex@alexcrichton.com> | 2014-09-19 18:15:50 -0700 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2014-09-19 18:15:50 -0700 |
commit | 3df90b4ca526ce910fa358c35e67041fc07ba5f8 (patch) | |
tree | 982e8abd73e5109f5e701e2891e95c84031ee75d /src/agent.rs | |
parent | b4a344e1cc48b8cf8e6aa9957b090e73f6f31646 (diff) | |
download | ssh2-rs-3df90b4ca526ce910fa358c35e67041fc07ba5f8.zip |
Beef up documentation
Diffstat (limited to 'src/agent.rs')
-rw-r--r-- | src/agent.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/agent.rs b/src/agent.rs index d3e4ed3..130f817 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -5,17 +5,22 @@ use std::str; use {raw, Session, Error}; +/// A structure representing a connection to an SSH agent. +/// +/// Agents can be used to authenticate a session. pub struct Agent<'a> { raw: *mut raw::LIBSSH2_AGENT, sess: &'a Session, marker: marker::NoSync, } +/// An iterator over the identities found in an SSH agent. pub struct Identities<'a> { prev: *mut raw::libssh2_agent_publickey, agent: &'a Agent<'a>, } +/// A public key which is extracted from an SSH agent. pub struct PublicKey<'a> { raw: *mut raw::libssh2_agent_publickey, marker1: marker::NoSync, @@ -97,6 +102,10 @@ impl<'a> Iterator<Result<PublicKey<'a>, Error>> for Identities<'a> { } impl<'a> PublicKey<'a> { + /// Creates a new public key from its raw counterpart. + /// + /// Unsafe because the validity of `raw` cannot be guaranteed and there are + /// no restrictions on the lifetime returned. pub unsafe fn from_raw<'a>(raw: *mut raw::libssh2_agent_publickey) -> PublicKey<'a> { PublicKey { |