Trait rocket::listener::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>

§Future Bounds

The Future generated by this async fn must be Send.

source

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

§Future Bounds

The Future generated by this async fn must be Send.

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

§

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

§

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

source§

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

source§

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

source§

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

source§

impl<L: Listener> Listener for &L

§

type Accept = <L as Listener>::Accept

§

type Connection = <L as Listener>::Connection

source§

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

source§

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

source§

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

Implementors§