Trait Service

Source
pub trait Service: 'static {
    type Output<'cx>;
    type Argument<'arg>;
}
Expand description

A key to an object that can be created by a Provider and stored in a Context.

In most cases, an implementation of this trait is trivial boilerplate, and so it is recommended to use the provided derive macro.

Required Associated Types§

Source

type Output<'cx>

The result of a service resolution

Source

type Argument<'arg>

An argument for the service provider

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.

Implementations on Foreign Types§

Source§

impl<S: Service> Service for &'static S

Source§

type Output<'cx> = &'cx <S as Service>::Output<'cx>

Source§

type Argument<'arg> = <S as Service>::Argument<'arg>

Source§

impl<S: Service> Service for &'static mut S

Source§

type Output<'cx> = &'cx mut <S as Service>::Output<'cx>

Source§

type Argument<'arg> = <S as Service>::Argument<'arg>

Implementors§