pub struct Session { /* private fields */ }Expand description
Immutable session state created by session_start / session_create.
Cloned (via Arc) into each module. Holds the project root and
cross-cutting concerns that every module may need.
alias and last_used_at are interior-mutable (RwLock) so the ledger
can rename or touch sessions without invalidating outstanding Arc<Session>
handles held by tool handlers.
Implementations§
Source§impl Session
impl Session
pub fn new(config: SessionConfig) -> Result<Self, CoreError>
pub fn root(&self) -> &Path
pub fn id(&self) -> &str
pub fn alias(&self) -> Option<String>
pub fn created_at(&self) -> u64
pub fn last_used_at(&self) -> u64
pub fn touch(&self)
pub fn timeout(&self) -> Duration
pub fn max_output(&self) -> usize
pub fn global_recipe_dirs(&self) -> &[PathBuf]
Sourcepub fn ensure_alive(&self) -> Result<(), SessionError>
pub fn ensure_alive(&self) -> Result<(), SessionError>
Check that the session root directory still exists.
Call this at each entry point (e.g. list, run) to detect a deleted
root before attempting I/O. Returns SessionError::RootGone if the
directory no longer exists.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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