summaryrefslogtreecommitdiff
path: root/src/agent.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-09-19 18:15:50 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-09-19 18:15:50 -0700
commit3df90b4ca526ce910fa358c35e67041fc07ba5f8 (patch)
tree982e8abd73e5109f5e701e2891e95c84031ee75d /src/agent.rs
parentb4a344e1cc48b8cf8e6aa9957b090e73f6f31646 (diff)
downloadssh2-rs-3df90b4ca526ce910fa358c35e67041fc07ba5f8.zip
Beef up documentation
Diffstat (limited to 'src/agent.rs')
-rw-r--r--src/agent.rs9
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 {