pub trait ServiceExt<R: ServiceRole>: Service<R> + Sized {
// Required method
fn serve_with_ct<T, E, A>(
self,
transport: T,
ct: CancellationToken,
) -> impl Future<Output = Result<RunningService<R, Self>, R::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::InitializeError>> + Send
where T: IntoTransport<R, E, A>,
E: Error + Send + Sync + 'static,
Self: Sized { ... }
}Available on crate features
client or server only.Required Methods§
fn serve_with_ct<T, E, A>( self, transport: T, ct: CancellationToken, ) -> impl Future<Output = Result<RunningService<R, Self>, R::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::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.
Implementors§
impl<S: Service<RoleClient>> ServiceExt<RoleClient> for S
Available on crate feature
client only.impl<S: Service<RoleServer>> ServiceExt<RoleServer> for S
Available on crate feature
server only.