Struct distant_core::TransportListener
source · [−]pub struct TransportListener<T, U> where
T: DataStream,
U: Codec, { /* private fields */ }Expand description
Represents a [Stream] consisting of newly-connected DataStream instances that
have been wrapped in Transport
Implementations
sourceimpl<T, U> TransportListener<T, U> where
T: DataStream + Send + 'static,
U: Codec + Send + 'static,
impl<T, U> TransportListener<T, U> where
T: DataStream + Send + 'static,
U: Codec + Send + 'static,
pub fn initialize<L, F>(listener: L, make_transport: F) -> Self where
L: Listener<Output = T> + 'static,
F: FnMut(T) -> Transport<T, U> + Send + 'static,
pub fn abort(&self)
sourcepub async fn accept(&mut self) -> Option<Transport<T, U>>
pub async fn accept(&mut self) -> Option<Transport<T, U>>
Waits for the next fully-initialized transport for an incoming stream to be available, returning none if no longer accepting new connections
sourcepub fn into_stream(self) -> impl Stream<Item = Transport<T, U>>
pub fn into_stream(self) -> impl Stream<Item = Transport<T, U>>
Converts into a stream of transport-wrapped connections
Auto Trait Implementations
impl<T, U> !RefUnwindSafe for TransportListener<T, U>
impl<T, U> Send for TransportListener<T, U> where
T: Send,
U: Send,
impl<T, U> Sync for TransportListener<T, U> where
T: Send,
U: Send,
impl<T, U> Unpin for TransportListener<T, U>
impl<T, U> !UnwindSafe for TransportListener<T, U>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more