pub struct AppState {
pub config: AppConfig,
/* private fields */
}Fields§
§config: AppConfigImplementations§
Source§impl AppState
impl AppState
pub fn from_database(database: Database) -> Self
pub async fn from_config_file(path: impl AsRef<Path>) -> AppResult<Self>
pub fn database(&self) -> &Database
Sourcepub fn with_database(self, database: Database) -> Self
pub fn with_database(self, database: Database) -> Self
Replace the database handle while preserving configuration and application services.
pub fn channels(&self) -> &Channels
pub fn app_channels(&self) -> &AppChannels
pub fn signals(&self) -> &SignalBus
pub fn with_current_user_resolver<T, F>(self, resolver: F) -> Self
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