Struct biodivine_sketchbook::app::state::editor::EditorSession
source · pub struct EditorSession {
id: String,
undo_stack: UndoStack,
tab_bar: TabBarState,
sketch: Sketch,
}
Expand description
The state of one editor session.
An editor session is the “main” app session where a model is created/edited and from which other sessions can be started.
Fields§
§id: String
§undo_stack: UndoStack
§tab_bar: TabBarState
§sketch: Sketch
Implementations§
source§impl EditorSession
impl EditorSession
pub fn new(id: &str) -> EditorSession
Trait Implementations§
source§impl SessionHelper for EditorSession
impl SessionHelper for EditorSession
source§fn starts_with<'a, 'b>(
prefix: &str,
at_path: &'a [&'b str],
) -> Option<&'a [&'b str]>
fn starts_with<'a, 'b>( prefix: &str, at_path: &'a [&'b str], ) -> Option<&'a [&'b str]>
A utility function which checks if
at_path
starts with a specific first segment.
If yes, returns the remaining part of the path.source§fn matches(expected: &[&str], at_path: &[&str]) -> bool
fn matches(expected: &[&str], at_path: &[&str]) -> bool
A utility function which checks if
at_path
is exactlysource§fn invalid_path_error_generic<T>(at_path: &[&str]) -> Result<T, DynError>
fn invalid_path_error_generic<T>(at_path: &[&str]) -> Result<T, DynError>
A utility function which emits a generic “invalid path” error.
source§fn invalid_path_error_specific<T>(
path: &[&str],
component: &str,
) -> Result<T, DynError>
fn invalid_path_error_specific<T>( path: &[&str], component: &str, ) -> Result<T, DynError>
A utility function which emits a “invalid path” error mentioning specific state’s
component
.source§fn clone_payload_str(event: &Event, component: &str) -> Result<String, DynError>
fn clone_payload_str(event: &Event, component: &str) -> Result<String, DynError>
A utility function to get and clone a payload of an event. Errors if payload is empty. Read more
source§impl SessionState for EditorSession
impl SessionState for EditorSession
source§impl StackSession for EditorSession
impl StackSession for EditorSession
source§fn process_message(
&mut self,
message: &SessionMessage,
) -> Result<(Option<SessionMessage>, Option<StateChange>), DynError>
fn process_message( &mut self, message: &SessionMessage, ) -> Result<(Option<SessionMessage>, Option<StateChange>), DynError>
Process a message sent to this session state object. Read more
source§fn id(&self) -> &str
fn id(&self) -> &str
Returns the string identifier of this particular session. Each session identifier must
be unique within the application.
source§fn undo_stack_mut(&mut self) -> &mut UndoStack
fn undo_stack_mut(&mut self) -> &mut UndoStack
Returns a mutable reference to session’s undo stack.
source§fn undo_stack(&self) -> &UndoStack
fn undo_stack(&self) -> &UndoStack
Returns an immutable reference to session’s undo stack.
source§fn perform_action(
&mut self,
action: &UserAction,
) -> Result<StateChange, DynError>
fn perform_action( &mut self, action: &UserAction, ) -> Result<StateChange, DynError>
Perform a user action on this session state object. This usually involves propagating
the events to the internal SessionState objects and collecting the results into a
single StateChange entry. Read more
source§fn perform_categorized_action(
&mut self,
action: &UserAction,
ignore_stack: bool,
) -> Result<StateChange, DynError>
fn perform_categorized_action( &mut self, action: &UserAction, ignore_stack: bool, ) -> Result<StateChange, DynError>
Perform a user action on this session state object, with additional information whether
the action should bypass the undo-redo stack. Read more
fn append_stack_updates(&self, state_changes: &mut Vec<Event>)
Auto Trait Implementations§
impl Freeze for EditorSession
impl RefUnwindSafe for EditorSession
impl Send for EditorSession
impl Sync for EditorSession
impl Unpin for EditorSession
impl UnwindSafe for EditorSession
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