ServiceExt

Trait ServiceExt 

Source
pub trait ServiceExt<R>: Sized + Service<R>
where R: ServiceRole,
{ // Required method fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + Send where T: IntoTransport<R, E, A>, E: Error + Send + Sync + 'static, Self: Sized; // Provided methods fn into_dyn(self) -> Box<dyn DynService<R>> { ... } fn serve<T, E, A>( self, transport: T, ) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + Send where T: IntoTransport<R, E, A>, E: Error + Send + Sync + 'static, Self: Sized { ... } }

Required Methods§

Source

fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + Send
where T: IntoTransport<R, E, A>, E: Error + Send + Sync + 'static, Self: Sized,

Provided Methods§

Source

fn into_dyn(self) -> Box<dyn DynService<R>>

Convert this service to a dynamic boxed service

This could be very helpful when you want to store the services in a collection

Source

fn serve<T, E, A>( self, transport: T, ) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + Send
where T: IntoTransport<R, E, A>, E: Error + Send + Sync + 'static, Self: Sized,

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.

Implementors§