Skip to main content

CtxExt

Trait CtxExt 

Source
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§

Source

fn typed_extension<T: TypedExtension>( &self, ) -> Result<Option<T>, TypedExtensionError>

Decodes one typed extension when the stable key is present.

Source

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".

Implementors§