InStreamTls

Struct InStreamTls 

Source
pub struct InStreamTls<Sub: InStreamStd> { /* private fields */ }
Expand description

basic tls wrapper stream

Implementations§

Source§

impl<Sub: InStreamStd> InStreamTls<Sub>

Source

pub fn connect(url: &Url2, config: TlsConnectConfig) -> Result<Self>

Trait Implementations§

Source§

impl<Sub: InStreamStd> Debug for InStreamTls<Sub>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Sub: InStreamStd> InStream<&mut [u8], &[u8]> for InStreamTls<Sub>

Source§

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>

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>

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 later
Source§

fn remote_url(&self) -> Url2

access the remote url this connection represents
Source§

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§

fn write(&mut self, data: &[u8]) -> Result<usize>

buffered write. Implementors should buffer data on WouldBlock
Source§

fn flush(&mut self) -> Result<()>

blocking flush all pending buffered write data.
Source§

impl<Sub: InStreamStd> InStreamStd for InStreamTls<Sub>

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T