Skip to main content

TlsListener

Struct TlsListener 

Source
pub struct TlsListener<L, T> { /* private fields */ }
Expand description

A listener paired with its configured TLS acceptor. Native scheduler listeners have accept and close conveniences. Other listener representations can use listener and acceptor to perform their own accept operation followed by the same TLS handshake contract.

Implementations§

Source§

impl<L, T> TlsListener<L, T>

Source

pub fn new(listener: L, acceptor: T) -> Self

Pair an existing listener with a TLS acceptor; no handshake takes place yet.

Source

pub fn listener(&self) -> &L

Borrow the underlying listener, for example to inspect its local address.

Source

pub fn acceptor(&self) -> &T

Borrow the provider for handshaking connections from a custom listener representation.

Source

pub fn into_parts(self) -> (L, T)

Recover the owned listener and TLS provider.

Source

pub async fn accept<S>( &self, scheduler: &S, cancellation: &Cancellation, ) -> OperationResult<(T::Connection, SocketAddress)>
where S: SocketAccept<Socket = L> + ?Sized, T: TlsAcceptor<S, L>,

Accept one native scheduler connection and complete its TLS handshake. Handshake failure closes that accepted connection through the provider and leaves the listener available for subsequent accepts. The caller drives concurrency explicitly by polling separate accept/connection operations.

Source

pub async fn close<S>(self, scheduler: &S) -> Result<()>
where S: SocketClose<Socket = L> + ?Sized,

Consume and close a native scheduler listener. Previously accepted connections remain independently owned by their callers.

Trait Implementations§

Source§

impl<L: Debug, T: Debug> Debug for TlsListener<L, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<L, T> Freeze for TlsListener<L, T>
where L: Freeze, T: Freeze,

§

impl<L, T> RefUnwindSafe for TlsListener<L, T>

§

impl<L, T> Send for TlsListener<L, T>
where L: Send, T: Send,

§

impl<L, T> Sync for TlsListener<L, T>
where L: Sync, T: Sync,

§

impl<L, T> Unpin for TlsListener<L, T>
where L: Unpin, T: Unpin,

§

impl<L, T> UnsafeUnpin for TlsListener<L, T>
where L: UnsafeUnpin, T: UnsafeUnpin,

§

impl<L, T> UnwindSafe for TlsListener<L, T>
where L: UnwindSafe, T: UnwindSafe,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.