pub struct AppState {Show 16 fields
pub db: Option<Arc<DatabasePool>>,
pub view: ViewEngine,
pub db_error: Option<String>,
pub csrf_config: CsrfConfig,
pub storage: Arc<Storage>,
pub config: Arc<ConfigManager>,
pub queue: Arc<QueueManager>,
pub cache: Arc<CacheManager>,
pub mail: Arc<Mail>,
pub registry: Arc<JobRegistry>,
pub events: Arc<EventDispatcher>,
pub telescope: Arc<TelescopeManager>,
pub lang: Arc<LangManager>,
pub echo: Arc<EchoManager>,
pub socialite: Arc<SocialiteManager>,
pub sandbox: Arc<LuminaPluginManager>,
}Expand description
State global yang dibagikan ke semua handler.
Fields§
§db: Option<Arc<DatabasePool>>§view: ViewEngine§db_error: Option<String>Pesan error database yang akan ditampilkan di halaman whoops.
csrf_config: CsrfConfig§storage: Arc<Storage>§config: Arc<ConfigManager>§queue: Arc<QueueManager>§cache: Arc<CacheManager>§mail: Arc<Mail>§registry: Arc<JobRegistry>§events: Arc<EventDispatcher>§telescope: Arc<TelescopeManager>§lang: Arc<LangManager>§echo: Arc<EchoManager>§sandbox: Arc<LuminaPluginManager>Implementations§
Source§impl AppState
impl AppState
Sourcepub fn script(&self, path: &str) -> ScriptHandle
pub fn script(&self, path: &str) -> ScriptHandle
Akses cepat untuk mengeksekusi file Indonesian Script (.is) di sandbox
Sourcepub fn db(&self) -> &DatabasePool
pub fn db(&self) -> &DatabasePool
Akses cepat ke Database Pool. Panik jika database tidak terhubung (seharusnya ditangani oleh db_guard).
Sourcepub fn cache(&self) -> &CacheManager
pub fn cache(&self) -> &CacheManager
Akses cepat ke CacheManager (in-memory).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Forget for AppState
impl Freeze for AppState
impl Move for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more