embedded_svc::http::server::asynch

Trait Connection

Source
pub trait Connection:
    Query
    + Headers
    + Read
    + Write {
    type Headers: Query + Headers;
    type Read: Read<Error = Self::Error>;
    type RawConnectionError: Error;
    type RawConnection: Read<Error = Self::RawConnectionError> + Write<Error = Self::RawConnectionError>;

    // Required methods
    fn split(&mut self) -> (&Self::Headers, &mut Self::Read);
    async fn initiate_response(
        &mut self,
        status: u16,
        message: Option<&str>,
        headers: &[(&str, &str)],
    ) -> Result<(), Self::Error>;
    fn is_response_initiated(&self) -> bool;
    fn raw_connection(
        &mut self,
    ) -> Result<&mut Self::RawConnection, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn split(&mut self) -> (&Self::Headers, &mut Self::Read)

Source

async fn initiate_response( &mut self, status: u16, message: Option<&str>, headers: &[(&str, &str)], ) -> Result<(), Self::Error>

Source

fn is_response_initiated(&self) -> bool

Source

fn raw_connection(&mut self) -> Result<&mut Self::RawConnection, Self::Error>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<C> Connection for &mut C
where C: Connection,

Source§

type Headers = <C as Connection>::Headers

Source§

type Read = <C as Connection>::Read

Source§

type RawConnectionError = <C as Connection>::RawConnectionError

Source§

type RawConnection = <C as Connection>::RawConnection

Source§

fn split(&mut self) -> (&Self::Headers, &mut Self::Read)

Source§

async fn initiate_response( &mut self, status: u16, message: Option<&str>, headers: &[(&str, &str)], ) -> Result<(), Self::Error>

Source§

fn is_response_initiated(&self) -> bool

Source§

fn raw_connection(&mut self) -> Result<&mut Self::RawConnection, Self::Error>

Implementors§