pub struct Application { /* private fields */ }Expand description
An application put together: its entities, its model and what makes frames. Layers from
the administrator and the user go on with layers_mut.
Implementations§
Source§impl Application
impl Application
Sourcepub fn builder(title: impl Into<String>) -> ApplicationBuilder
pub fn builder(title: impl Into<String>) -> ApplicationBuilder
Starts an application with this title.
Sourcepub fn entities(&self) -> &[EntityInfo]
pub fn entities(&self) -> &[EntityInfo]
Every entity it knows.
Sourcepub fn unusable(&self) -> &[UnusableNode]
pub fn unusable(&self) -> &[UnusableNode]
What in the layers has nowhere to go.
Sourcepub fn layers_mut(&mut self) -> &mut ModelLayers
pub fn layers_mut(&mut self) -> &mut ModelLayers
Its layers. Call refresh_model after changing them.
Sourcepub fn set_language(&mut self, language: &str) -> Result<(), ModelError>
pub fn set_language(&mut self, language: &str) -> Result<(), ModelError>
Shows the model in this language, from the translation given for it; one that was not given brings back what was declared.
Sourcepub fn export_captions(&self) -> String
pub fn export_captions(&self) -> String
What people see in the model, for translating outside the code: a line per caption, as CSV with its path, the caption and an empty column for the translation.
Sourcepub fn import_captions(
&mut self,
language: &str,
csv: &str,
) -> Result<(), ModelError>
pub fn import_captions( &mut self, language: &str, csv: &str, ) -> Result<(), ModelError>
Takes what export_captions gave, with its last column filled in,
as the model in this language. Lines left empty stay as they were. What points to nothing
shows in unusable once the language is picked.
Sourcepub fn run_initial_records(
&self,
space: &mut dyn ObjectSpace,
) -> Result<(), String>
pub fn run_initial_records( &self, space: &mut dyn ObjectSpace, ) -> Result<(), String>
Puts in place the records every module needs, and keeps them.
Sourcepub fn set_typed_setting(
&mut self,
path: &[&str],
name: &str,
text: &str,
) -> Result<(), ModelError>
pub fn set_typed_setting( &mut self, path: &[&str], name: &str, text: &str, ) -> Result<(), ModelError>
Keeps a setting typed as text in the person’s own layer, and applies it. It stays what it
was: a number has to be typed as a number, and yes or no as true or false.
Sourcepub fn clear_user_settings(&mut self) -> Result<(), ModelError>
pub fn clear_user_settings(&mut self) -> Result<(), ModelError>
Throws away the person’s own layer of the model.
Sourcepub fn set_user_setting(
&mut self,
path: &[&str],
name: &str,
value: &str,
) -> Result<(), ModelError>
pub fn set_user_setting( &mut self, path: &[&str], name: &str, value: &str, ) -> Result<(), ModelError>
Keeps a setting in the person’s own layer of the model, and applies it.
Sourcepub fn refresh_model(&mut self) -> Result<(), ModelError>
pub fn refresh_model(&mut self) -> Result<(), ModelError>
Applies the layers again. Frames made after this see the result; views already showing have to be shown again.
Sourcepub fn set_security(&mut self, security: Rc<SecurityContext>)
pub fn set_security(&mut self, security: Rc<SecurityContext>)
What every frame made from now on goes by, for who is signed in.
Sourcepub fn new_frame(
&self,
context: FrameContext,
space: Rc<RefCell<dyn ObjectSpace>>,
) -> Frame
pub fn new_frame( &self, context: FrameContext, space: Rc<RefCell<dyn ObjectSpace>>, ) -> Frame
A frame with new controllers from every module, in order, over this unit of work.