Skip to main content

Module service

Module service 

Source

Modules§

function
grpc
http
registry
worker

Traits§

Service
Trait to represent a service (e.g., a persistent task) to run in the app.
ServiceAsAny
Allows getting an &dyn Any reference to the Service. This is to enable getting a concrete reference to a specific Service implementation from the registry::ServiceRegistry (which works via a downcast) in order to call methods that are specific to a certain implementation. See registry::ServiceRegistry::get for more details and examples.
ServiceBuilder
Trait used to build a Service. It’s not a requirement that services implement this trait; it is provided as a convenience. A builder can be provided to the ServiceRegistry instead of a Service, in which case the ServiceRegistry will only build and register the service if Service::enabled is true.