pub trait CtxExt: Sized {
// Required methods
fn typed_extension<T: TypedExtension>(
&self,
) -> Result<Option<T>, TypedExtensionError>;
fn with_typed_extension<T: TypedExtension>(
self,
value: &T,
) -> Result<Self, TypedExtensionError>;
}Expand description
Typed ordinary-extension helpers for InvocationContext.
Required Methods§
Sourcefn typed_extension<T: TypedExtension>(
&self,
) -> Result<Option<T>, TypedExtensionError>
fn typed_extension<T: TypedExtension>( &self, ) -> Result<Option<T>, TypedExtensionError>
Decodes one typed extension when the stable key is present.
Sourcefn with_typed_extension<T: TypedExtension>(
self,
value: &T,
) -> Result<Self, TypedExtensionError>
fn with_typed_extension<T: TypedExtension>( self, value: &T, ) -> Result<Self, TypedExtensionError>
Encodes and attaches one typed extension without replacing an existing key.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".