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§
Sourcetype Token: ServiceToken
type Token: ServiceToken
The token type this reference points to
Provided Methods§
Sourcefn token_type() -> PhantomData<Self::Token>
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.