Struct biodivine_sketchbook::app::state::inference::InferenceSession
source · pub struct InferenceSession {
id: String,
undo_stack: UndoStack,
inference_state: InferenceState,
}
Expand description
The state of one editor session.
An inference session is the session where the process of the inference is run on a given model.
Fields§
§id: String
§undo_stack: UndoStack
§inference_state: InferenceState
Implementations§
source§impl InferenceSession
impl InferenceSession
pub fn new(id: &str) -> InferenceSession
Trait Implementations§
source§impl SessionHelper for InferenceSession
impl SessionHelper for InferenceSession
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 InferenceSession
impl SessionState for InferenceSession
source§impl StackSession for InferenceSession
impl StackSession for InferenceSession
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 InferenceSession
impl !RefUnwindSafe for InferenceSession
impl Send for InferenceSession
impl !Sync for InferenceSession
impl Unpin for InferenceSession
impl !UnwindSafe for InferenceSession
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