pub struct Session { /* private fields */ }Expand description
Immutable session state created by session_start.
Cloned (via Arc) into each module. Holds the project root and
cross-cutting concerns that every module may need.
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 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