Trait ContextTrait

Source
pub trait ContextTrait:
    Clone
    + Send
    + Sync
    + 'static {
    type Ext: ContextExt<Self>;

    // Required methods
    fn names_plural(&self) -> impl Iterator<Item = impl AsRef<str>>;
    fn editor(&self) -> Option<&EditorConfig>;
    fn uploads_dir(&self) -> &Path;
    fn ext(&self) -> &Self::Ext;
}
Expand description

Trait implemented by the context available in all endpoints using axum::extract::State.

Required Associated Types§

Source

type Ext: ContextExt<Self>

Required Methods§

Source

fn names_plural(&self) -> impl Iterator<Item = impl AsRef<str>>

Source

fn editor(&self) -> Option<&EditorConfig>

Source

fn uploads_dir(&self) -> &Path

Source

fn ext(&self) -> &Self::Ext

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.

Implementors§

Source§

impl<E: ContextExt<Self> + 'static> ContextTrait for Context<E>

Source§

type Ext = E