pub struct Store { /* private fields */ }Implementations§
Source§impl Store
impl Store
pub fn from_project_root(project_root: impl AsRef<Path>) -> Self
pub fn from_storage_root(storage_root: impl AsRef<Path>) -> Self
Sourcepub async fn resolve_from_context(ctx: &RepositoryContext) -> StoreResult<Self>
pub async fn resolve_from_context(ctx: &RepositoryContext) -> StoreResult<Self>
§Errors
Returns an error when global storage cannot be resolved or an existing local .parley
marker is not a directory.
Sourcepub async fn resolve(project_root: impl AsRef<Path>) -> StoreResult<Self>
pub async fn resolve(project_root: impl AsRef<Path>) -> StoreResult<Self>
§Errors
Returns an error when global storage cannot be resolved or an existing local .parley
marker is not a directory.
Sourcepub async fn resolve_with_global_root(
project_root: impl AsRef<Path>,
global_root: impl AsRef<Path>,
) -> StoreResult<Self>
pub async fn resolve_with_global_root( project_root: impl AsRef<Path>, global_root: impl AsRef<Path>, ) -> StoreResult<Self>
§Errors
Returns an error when an existing local .parley marker is not a directory.
Sourcepub async fn resolve_with_local_and_global_root(
local_root: impl AsRef<Path>,
storage_root: impl AsRef<Path>,
global_root: impl AsRef<Path>,
project_root: &Path,
) -> StoreResult<Self>
pub async fn resolve_with_local_and_global_root( local_root: impl AsRef<Path>, storage_root: impl AsRef<Path>, global_root: impl AsRef<Path>, project_root: &Path, ) -> StoreResult<Self>
§Errors
Returns an error when an existing local .parley marker is not a directory.
Prefers local_root if it exists, falls back to storage_root, then to global storage.
pub fn root_path(&self) -> &Path
Sourcepub async fn ensure_dirs(&self) -> StoreResult<()>
pub async fn ensure_dirs(&self) -> StoreResult<()>
§Errors
Returns an error when the .parley review directories cannot be created.
Sourcepub async fn create_review(&self, session: &ReviewSession) -> StoreResult<()>
pub async fn create_review(&self, session: &ReviewSession) -> StoreResult<()>
§Errors
Returns an error when the review name is invalid or the review cannot be written.
Sourcepub async fn save_review(&self, session: &ReviewSession) -> StoreResult<()>
pub async fn save_review(&self, session: &ReviewSession) -> StoreResult<()>
§Errors
Returns an error when the review name is invalid, directories cannot be created, the session cannot be serialized, or the review file cannot be written.
Sourcepub async fn load_review(&self, name: &str) -> StoreResult<ReviewSession>
pub async fn load_review(&self, name: &str) -> StoreResult<ReviewSession>
§Errors
Returns an error when the review name is invalid, the review is missing, or review data cannot be read or deserialized.
Sourcepub async fn list_reviews(&self) -> StoreResult<Vec<String>>
pub async fn list_reviews(&self) -> StoreResult<Vec<String>>
§Errors
Returns an error when review directories cannot be read or persisted review files cannot be deserialized.
Sourcepub fn review_log_path(&self, review_name: &str) -> StoreResult<PathBuf>
pub fn review_log_path(&self, review_name: &str) -> StoreResult<PathBuf>
§Errors
Returns an error when review_name is invalid.
Sourcepub async fn load_config(&self) -> StoreResult<AppConfig>
pub async fn load_config(&self) -> StoreResult<AppConfig>
§Errors
Returns an error when config directories cannot be created or config data cannot be read or deserialized.
Sourcepub async fn save_config(&self, config: &AppConfig) -> StoreResult<()>
pub async fn save_config(&self, config: &AppConfig) -> StoreResult<()>
§Errors
Returns an error when config directories cannot be created, config data cannot be serialized, or the config file cannot be written.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
impl UnwindSafe for Store
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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