pub struct InStreamTls<Sub: InStreamStd> { /* private fields */ }
Expand description
basic tls wrapper stream
Implementations§
Source§impl<Sub: InStreamStd> InStreamTls<Sub>
impl<Sub: InStreamStd> InStreamTls<Sub>
pub fn connect(url: &Url2, config: TlsConnectConfig) -> Result<Self>
Trait Implementations§
Source§impl<Sub: InStreamStd> Debug for InStreamTls<Sub>
impl<Sub: InStreamStd> Debug for InStreamTls<Sub>
Source§impl<Sub: InStreamStd> InStream<&mut [u8], &[u8]> for InStreamTls<Sub>
impl<Sub: InStreamStd> InStream<&mut [u8], &[u8]> for InStreamTls<Sub>
Source§const URL_SCHEME: &'static str = SCHEME
const URL_SCHEME: &'static str = SCHEME
your implementation should work with a single url scheme/protocol
if you need to support multiple (i.e. ws:// vs wss://) consider
using macros/code generation to DRY
Source§fn raw_connect<C: InStreamConfig>(url: &Url2, config: C) -> Result<Self>
fn raw_connect<C: InStreamConfig>(url: &Url2, config: C) -> Result<Self>
create a new connection / stream of this type.
this function does the actual work of connecting, but it is recommended
your struct provide a wrapper with a concrete config type
Source§fn check_ready(&mut self) -> Result<bool>
fn check_ready(&mut self) -> Result<bool>
process the stream to see if any remaining handshake items can be completed
returns
true
if stream is set-up and ready to send/receive
note that you can write before this function returns true
but your messages may be buffered / sent laterSource§fn remote_url(&self) -> Url2
fn remote_url(&self) -> Url2
access the remote url this connection represents
Source§fn read(&mut self, data: &mut [u8]) -> Result<usize>
fn read(&mut self, data: &mut [u8]) -> Result<usize>
non-blocking read.
if R is an array-type, success result is number of elements read
otherwise it is 1
Source§impl<Sub: InStreamStd> InStreamStd for InStreamTls<Sub>
impl<Sub: InStreamStd> InStreamStd for InStreamTls<Sub>
fn into_std_stream(self) -> StdStreamAdapter<Self> ⓘ
Auto Trait Implementations§
impl<Sub> Freeze for InStreamTls<Sub>
impl<Sub> !RefUnwindSafe for InStreamTls<Sub>
impl<Sub> Send for InStreamTls<Sub>
impl<Sub> Sync for InStreamTls<Sub>
impl<Sub> Unpin for InStreamTls<Sub>where
Sub: Unpin,
impl<Sub> !UnwindSafe for InStreamTls<Sub>
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