pub struct GlobalState {
pub memorydb: Arc<dyn MemoryDB>,
pub config: Config,
pub logger: Option<Logger>,
pub locale: Locale,
pub server: ServerHandle,
}Available on crate feature
state only.Expand description
Shared application state, stored as actix-web Data<GlobalState>.
Fields§
§memorydb: Arc<dyn MemoryDB>Available on crate feature
memorydb only.Shared key-value database (sessions, CSRF tokens, …).
config: ConfigAvailable on crate feature
config only.Application configuration loaded through the config crate.
logger: Option<Logger>Available on crate feature
logger only.Global logger.
locale: LocaleAvailable on crate feature
i18n only.Default locale; used when the request middleware cannot identify a language.
server: ServerHandleHandle server state.
Implementations§
Auto Trait Implementations§
impl !Freeze for GlobalState
impl !RefUnwindSafe for GlobalState
impl !UnwindSafe for GlobalState
impl Send for GlobalState
impl Sync for GlobalState
impl Unpin for GlobalState
impl UnsafeUnpin for GlobalState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more