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§
fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + Send
Provided Methods§
Sourcefn into_dyn(self) -> Box<dyn DynService<R>>
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
fn serve<T, E, A>( self, transport: T, ) -> impl Future<Output = Result<RunningService<R, Self>, <R as ServiceRole>::InitializeError>> + Send
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.