Struct AppStorage
pub struct AppStorage { /* private fields */ }Expand description
What an app keeps outside its documents, scoped to the app and the settings document its host gave it: its files, its secrets and its typed settings. Framework views and surfaces reach it through their context.
Implementations§
§impl AppStorage
impl AppStorage
pub fn new(
app_id: &str,
secrets: SecretStore,
settings: SettingsDocument,
) -> AppStorage
pub fn new( app_id: &str, secrets: SecretStore, settings: SettingsDocument, ) -> AppStorage
Storage of the app app_id with these secrets and settings.
pub fn with_files(self, files: AppFiles) -> AppStorage
pub fn with_files(self, files: AppFiles) -> AppStorage
The same storage with the app’s file areas at files: a test or
capture profile’s own instead of the person’s.
pub fn for_app(app_id: &str) -> AppStorage
pub fn for_app(app_id: &str) -> AppStorage
Storage of the app app_id in the current host’s secret store and
the session settings document.
pub fn secrets(&self) -> SecretStore
pub fn secrets(&self) -> SecretStore
The app’s secrets. A secret that belongs to one document item is
SecretStore::item.
pub fn settings<T>(&self) -> Settings<T>where
T: SettingsSchema,
pub fn settings<T>(&self) -> Settings<T>where
T: SettingsSchema,
The app’s typed settings of type T.
pub fn settings_document(&self) -> &SettingsDocument
pub fn settings_document(&self) -> &SettingsDocument
The settings document the host gave the app.
Trait Implementations§
§impl Clone for AppStorage
impl Clone for AppStorage
§fn clone(&self) -> AppStorage
fn clone(&self) -> AppStorage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AppStorage
impl !RefUnwindSafe for AppStorage
impl Send for AppStorage
impl Sync for AppStorage
impl Unpin for AppStorage
impl UnsafeUnpin for AppStorage
impl !UnwindSafe for AppStorage
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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