Skip to main content

Listener

Trait Listener 

Source
pub trait Listener:
    Sized
    + Send
    + Sync {
    type Accept: Send;
    type Connection: Connection;

    // Required methods
    async fn accept(&self) -> Result<Self::Accept>;
    async fn connect(&self, accept: Self::Accept) -> Result<Self::Connection>;
    fn endpoint(&self) -> Result<Endpoint>;
}

Required Associated Types§

Required Methods§

Source

async fn accept(&self) -> Result<Self::Accept>

Available on non-rust_analyzer only.
§Future Bounds

The Future generated by this async fn must be Send.

Source

async fn connect(&self, accept: Self::Accept) -> Result<Self::Connection>

Available on non-rust_analyzer only.
§Future Bounds

The Future generated by this async fn must be Send.

Source

fn endpoint(&self) -> Result<Endpoint>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<A: Listener, B: Listener> Listener for Either<A, B>

Source§

type Accept = Either<<A as Listener>::Accept, <B as Listener>::Accept>

Source§

type Connection = Either<<A as Listener>::Connection, <B as Listener>::Connection>

Source§

async fn accept(&self) -> Result<Self::Accept>

Available on non-rust_analyzer only.
Source§

async fn connect(&self, accept: Self::Accept) -> Result<Self::Connection>

Available on non-rust_analyzer only.
Source§

fn endpoint(&self) -> Result<Endpoint>

Source§

impl<L: Listener> Listener for &L

Source§

type Accept = <L as Listener>::Accept

Source§

type Connection = <L as Listener>::Connection

Source§

async fn accept(&self) -> Result<Self::Accept>

Available on non-rust_analyzer only.
Source§

async fn connect(&self, accept: Self::Accept) -> Result<Self::Connection>

Available on non-rust_analyzer only.
Source§

fn endpoint(&self) -> Result<Endpoint>

Implementors§