Trait sozu_lib::server::ProxySessionCast[][src]

pub trait ProxySessionCast: ProxySession {
    fn as_tcp(&mut self) -> &mut Session;
fn as_http(&mut self) -> &mut Session;
fn as_https_rustls(&mut self) -> &mut Session; }

this trait is used to work around the fact that we need to transform the sessions (that are all stored as a ProxySession in the slab) back to their original type to call the connect_to_backend method of their corresponding Proxy. If we find a way to make connect_to_backend work wothout transforming back to the type (example: storing a reference to the configuration in the session and making connect_to_backend a method of ProxySession?), we’ll be able to remove all those ugly casts and panics

Required methods

fn as_tcp(&mut self) -> &mut Session[src]

fn as_http(&mut self) -> &mut Session[src]

fn as_https_rustls(&mut self) -> &mut Session[src]

Implementors

impl ProxySessionCast for sozu_lib::http::Session[src]

impl ProxySessionCast for sozu_lib::https_rustls::session::Session[src]

impl ProxySessionCast for sozu_lib::tcp::Session[src]

impl ProxySessionCast for ListenSession[src]