Skip to main content

Server

Struct Server 

Source
pub struct Server<St, H, Ctl, Pb> { /* private fields */ }
Expand description

Amqp server factory

Implementations§

Source§

impl<St> Server<St, (), (), ()>
where St: 'static,

Source

pub fn build<F, H>( handshake: F, ) -> ServerBuilder<St, H, DefaultControlService<St, H::Error>>

Start server building process with provided handshake service

Trait Implementations§

Source§

impl<F, St, H, Ctl, Pb> ServiceFactory<Io<F>, SharedCfg> for Server<St, H, Ctl, Pb>
where F: Filter, St: 'static, H: ServiceFactory<Handshake, SharedCfg, Response = HandshakeAck<St>> + 'static, Ctl: ServiceFactory<ControlFrame, State<St>, Response = ()> + 'static, Ctl::InitError: Debug, Pb: ServiceFactory<Message, State<St>, Response = ()> + 'static, Pb::InitError: Debug, Error: From<Pb::Error> + From<Ctl::Error>,

Source§

type Response = ()

Responses given by the created services.
Source§

type Error = ServerError<<H as ServiceFactory<Handshake, SharedCfg>>::Error>

Errors produced by the created services.
Source§

type Service = ServerHandler<St, <H as ServiceFactory<Handshake, SharedCfg>>::Service, Ctl, Pb>

The type of Service produced by this factory.
Source§

type InitError = <H as ServiceFactory<Handshake, SharedCfg>>::InitError

Possible errors encountered during service construction.
Source§

async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.
Source§

impl<St, H, Ctl, Pb> ServiceFactory<IoBoxed, SharedCfg> for Server<St, H, Ctl, Pb>
where St: 'static, H: ServiceFactory<Handshake, SharedCfg, Response = HandshakeAck<St>> + 'static, Ctl: ServiceFactory<ControlFrame, State<St>, Response = ()> + 'static, Ctl::InitError: Debug, Pb: ServiceFactory<Message, State<St>, Response = ()> + 'static, Pb::InitError: Debug, Error: From<Pb::Error> + From<Ctl::Error>,

Source§

type Response = ()

Responses given by the created services.
Source§

type Error = ServerError<<H as ServiceFactory<Handshake, SharedCfg>>::Error>

Errors produced by the created services.
Source§

type Service = ServerHandler<St, <H as ServiceFactory<Handshake, SharedCfg>>::Service, Ctl, Pb>

The type of Service produced by this factory.
Source§

type InitError = <H as ServiceFactory<Handshake, SharedCfg>>::InitError

Possible errors encountered during service construction.
Source§

async fn create(&self, cfg: SharedCfg) -> Result<Self::Service, Self::InitError>

Creates a new service asynchronously and returns it.
Source§

async fn pipeline( &self, cfg: Cfg, ) -> Result<Pipeline<Self::Service>, Self::InitError>
where Self: Sized,

Asynchronously creates a new service and wraps it in a container.
Source§

fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
where Self: Sized, F: Fn(Self::Response) -> Res + Clone,

Returns a new service that maps this service’s output to a different type.
Source§

fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::Error) -> E + Clone,

Transforms this service’s error into another error, producing a new service.
Source§

fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
where Self: Sized, F: Fn(Self::InitError) -> E + Clone,

Maps this factory’s initialization error to a different error, returning a new service factory.
Source§

fn boxed( self, ) -> BoxServiceFactory<Cfg, Req, Self::Response, Self::Error, Self::InitError>
where Cfg: 'static, Req: 'static, Self: Sized + 'static,

Creates a boxed service factory.

Auto Trait Implementations§

§

impl<St, H, Ctl, Pb> Freeze for Server<St, H, Ctl, Pb>
where H: Freeze,

§

impl<St, H, Ctl, Pb> RefUnwindSafe for Server<St, H, Ctl, Pb>

§

impl<St, H, Ctl, Pb> !Send for Server<St, H, Ctl, Pb>

§

impl<St, H, Ctl, Pb> !Sync for Server<St, H, Ctl, Pb>

§

impl<St, H, Ctl, Pb> Unpin for Server<St, H, Ctl, Pb>
where H: Unpin,

§

impl<St, H, Ctl, Pb> UnsafeUnpin for Server<St, H, Ctl, Pb>
where H: UnsafeUnpin,

§

impl<St, H, Ctl, Pb> UnwindSafe for Server<St, H, Ctl, Pb>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, Req, Cfg> IntoServiceFactory<T, Req, Cfg> for T
where T: ServiceFactory<Req, Cfg>,

Source§

fn into_factory(self) -> T

Convert Self to a ServiceFactory
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.