diff options
author | Alex Crichton <alex@alexcrichton.com> | 2014-12-19 08:34:03 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2014-12-19 08:34:17 -0800 |
commit | c6998c5c338451892d5d6771603b9d69f58842bd (patch) | |
tree | a12a2de6d04000a65cf6509fc57b64f9644685e8 /src/agent.rs | |
parent | 4a1ad3717c6a38d2dfc07806c5a5069c58a92288 (diff) | |
download | ssh2-rs-c6998c5c338451892d5d6771603b9d69f58842bd.zip |
Update to rust master
Diffstat (limited to 'src/agent.rs')
-rw-r--r-- | src/agent.rs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/agent.rs b/src/agent.rs index 130f817..0083443 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -8,28 +8,28 @@ 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> { +pub struct Agent<'sess> { raw: *mut raw::LIBSSH2_AGENT, - sess: &'a Session, + sess: &'sess Session, marker: marker::NoSync, } /// An iterator over the identities found in an SSH agent. -pub struct Identities<'a> { +pub struct Identities<'agent> { prev: *mut raw::libssh2_agent_publickey, - agent: &'a Agent<'a>, + agent: &'agent Agent<'agent>, } /// A public key which is extracted from an SSH agent. -pub struct PublicKey<'a> { +pub struct PublicKey<'agent> { raw: *mut raw::libssh2_agent_publickey, marker1: marker::NoSync, marker2: marker::NoSend, - marker3: marker::ContravariantLifetime<'a>, + marker3: marker::ContravariantLifetime<'agent>, marker4: marker::NoCopy, } -impl<'a> Agent<'a> { +impl<'sess> Agent<'sess> { /// Wraps a raw pointer in a new Agent structure tied to the lifetime of the /// given session. /// @@ -86,8 +86,8 @@ impl<'a> Drop for Agent<'a> { } } -impl<'a> Iterator<Result<PublicKey<'a>, Error>> for Identities<'a> { - fn next(&mut self) -> Option<Result<PublicKey<'a>, Error>> { +impl<'agent> Iterator<Result<PublicKey<'agent>, Error>> for Identities<'agent> { + fn next(&mut self) -> Option<Result<PublicKey<'agent>, Error>> { unsafe { let mut next = 0 as *mut _; match raw::libssh2_agent_get_identity(self.agent.raw, @@ -101,13 +101,13 @@ impl<'a> Iterator<Result<PublicKey<'a>, Error>> for Identities<'a> { } } -impl<'a> PublicKey<'a> { +impl<'agent> PublicKey<'agent> { /// 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> { + pub unsafe fn from_raw(raw: *mut raw::libssh2_agent_publickey) + -> PublicKey<'agent> { PublicKey { raw: raw, marker1: marker::NoSync, |