Skip to main content

Application

Struct Application 

Source
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

Source

pub fn builder(title: impl Into<String>) -> ApplicationBuilder

Starts an application with this title.

Source

pub fn title(&self) -> &str

Its title.

Source

pub fn entities(&self) -> &[EntityInfo]

Every entity it knows.

Source

pub fn model(&self) -> Rc<ModelNode>

The model as it stands.

Source

pub fn unusable(&self) -> &[UnusableNode]

What in the layers has nowhere to go.

Source

pub fn layers_mut(&mut self) -> &mut ModelLayers

Its layers. Call refresh_model after changing them.

Source

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.

Source

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.

Source

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.

Source

pub fn run_initial_records( &self, space: &mut dyn ObjectSpace, ) -> Result<(), String>

Puts in place the records every module needs, and keeps them.

Source

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.

Source

pub fn clear_user_settings(&mut self) -> Result<(), ModelError>

Throws away the person’s own layer of the model.

Source

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.

Source

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.

Source

pub fn set_security(&mut self, security: Rc<SecurityContext>)

What every frame made from now on goes by, for who is signed in.

Source

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.

Trait Implementations§

Source§

impl Debug for Application

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.