pub struct Session {
pub dir: PathBuf,
pub metadata: SessionMetadata,
pub overlay: OverlayMetadata,
}Fields§
§dir: PathBuf§metadata: SessionMetadata§overlay: OverlayMetadataImplementations§
Source§impl Session
impl Session
Sourcepub fn create(session_dir: &Path, image_path: &Path) -> Result<Self>
pub fn create(session_dir: &Path, image_path: &Path) -> Result<Self>
Create a new session, computing the SHA-256 of the image and persisting
session.json plus an empty overlay/metadata.json.
Sourcepub fn resume(session_dir: &Path, image_path: &Path) -> Result<Self>
pub fn resume(session_dir: &Path, image_path: &Path) -> Result<Self>
Resume an existing session, verifying the image hash matches.
Sourcepub fn overlay_file_path(&self, id: &str) -> PathBuf
pub fn overlay_file_path(&self, id: &str) -> PathBuf
Return the filesystem path for an overlay file by id.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more