pub struct SessionManager {
pub engine: RealityEngine,
pub data_path: Option<String>,
pub workspace_id: Option<String>,
pub autosave: bool,
}Expand description
Manages the reality engine session.
Fields§
§engine: RealityEngineThe reality engine instance.
data_path: Option<String>Path to the .areal data file (if persistence is enabled).
workspace_id: Option<String>Workspace identifier derived from the canonical data path.
autosave: boolWhether autosave is enabled.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn set_autosave(&mut self, enabled: bool)
pub fn set_autosave(&mut self, enabled: bool)
Enable or disable autosave.
Sourcepub fn save(&mut self) -> Result<bool, SessionError>
pub fn save(&mut self) -> Result<bool, SessionError>
Save the session to disk if a data path is configured.
Returns Ok(true) if data was written, Ok(false) if no path is set.
Sourcepub fn load(&mut self) -> Result<bool, SessionError>
pub fn load(&mut self) -> Result<bool, SessionError>
Load session data from disk if a data path is configured.
Returns Ok(true) if data was loaded, Ok(false) if no path or file missing.
Sourcepub fn autosave_if_dirty(&mut self) -> Result<bool, SessionError>
pub fn autosave_if_dirty(&mut self) -> Result<bool, SessionError>
Save if dirty and autosave is enabled.
Sourcepub fn workspace_id(&self) -> Option<&str>
pub fn workspace_id(&self) -> Option<&str>
Get the workspace identifier.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SessionManager
impl RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl UnsafeUnpin for SessionManager
impl UnwindSafe for SessionManager
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