Loading openssl/src/lib.rs +1 −1 Original line number Diff line number Diff line #![feature(unsafe_destructor, core, io, std_misc, path, os, unique)] #![feature(unsafe_destructor, core, io, std_misc, net, path, os, unique)] #![cfg_attr(test, feature(net, fs))] #![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/openssl")] Loading openssl/src/ssl/mod.rs +12 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ use std::io; use std::io::prelude::*; use std::ffi::AsOsStr; use std::mem; use std::net; use std::num::FromPrimitive; use std::num::Int; use std::path::Path; Loading Loading @@ -437,6 +438,17 @@ pub struct SslStream<S> { buf: Vec<u8> } impl SslStream<net::TcpStream> { /// Create a new independently owned handle to the underlying socket. pub fn try_clone(&self) -> io::Result<SslStream<net::TcpStream>> { Ok(SslStream { stream: try!(self.stream.try_clone()), ssl: self.ssl.clone(), buf: self.buf.clone(), }) } } impl<S> fmt::Debug for SslStream<S> where S: fmt::Debug { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { write!(fmt, "SslStream {{ stream: {:?}, ssl: {:?} }}", self.stream, self.ssl) Loading Loading
openssl/src/lib.rs +1 −1 Original line number Diff line number Diff line #![feature(unsafe_destructor, core, io, std_misc, path, os, unique)] #![feature(unsafe_destructor, core, io, std_misc, net, path, os, unique)] #![cfg_attr(test, feature(net, fs))] #![doc(html_root_url="https://sfackler.github.io/rust-openssl/doc/openssl")] Loading
openssl/src/ssl/mod.rs +12 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ use std::io; use std::io::prelude::*; use std::ffi::AsOsStr; use std::mem; use std::net; use std::num::FromPrimitive; use std::num::Int; use std::path::Path; Loading Loading @@ -437,6 +438,17 @@ pub struct SslStream<S> { buf: Vec<u8> } impl SslStream<net::TcpStream> { /// Create a new independently owned handle to the underlying socket. pub fn try_clone(&self) -> io::Result<SslStream<net::TcpStream>> { Ok(SslStream { stream: try!(self.stream.try_clone()), ssl: self.ssl.clone(), buf: self.buf.clone(), }) } } impl<S> fmt::Debug for SslStream<S> where S: fmt::Debug { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { write!(fmt, "SslStream {{ stream: {:?}, ssl: {:?} }}", self.stream, self.ssl) Loading