TokenReference

Trait TokenReference 

Source
pub trait TokenReference {
    type Token: ServiceToken;

    // Provided method
    fn token_type() -> PhantomData<Self::Token> { ... }
}
Expand description

Helper trait for working with token references in injection

This trait is implemented for reference types (&Token) to enable seamless resolution of tokens through references in dependency injection.

Required Associated Types§

Source

type Token: ServiceToken

The token type this reference points to

Provided Methods§

Source

fn token_type() -> PhantomData<Self::Token>

Get the token type

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<T: ServiceToken> TokenReference for &T

Source§

type Token = T

Implementors§