use std::fmt;
use std::path::{Path, PathBuf};
use crate::SessionId;
use crate::pal::error::PalError;
use crate::session_record::{ProcessIdentity, SessionRecord};
#[cfg_attr(test, mockall::automock)]
pub(crate) trait SessionStore: Send + Sync + fmt::Debug + 'static {
#[cfg(test)]
fn root(&self) -> PathBuf;
fn allocate_id(&self, owner: &ProcessIdentity) -> Result<SessionId, PalError>;
fn publish(&self, record: &SessionRecord) -> Result<(), PalError>;
fn read(&self, id: SessionId) -> Result<Option<SessionRecord>, PalError>;
fn list(&self) -> Result<Vec<SessionRecord>, PalError>;
fn list_reservations(&self) -> Result<Vec<(SessionId, ProcessIdentity)>, PalError>;
fn delete_owned_by(&self, id: SessionId, owner: &ProcessIdentity) -> Result<(), PalError>;
fn canonicalize(&self, path: &Path) -> Result<PathBuf, PalError>;
fn current_dir(&self) -> Result<PathBuf, PalError>;
}