pub struct StoreLayout { /* private fields */ }Expand description
The host’s on-disk layout for stores: which directory they live under.
One rule shared by create, open, join, and restore, so a host that wants
libraries/<id> instead of coven’s default stores/<id> names it once
here rather than each flow hardwiring (or working around) coven’s own
choice.
Implementations§
Source§impl StoreLayout
impl StoreLayout
pub fn new(app_dir: impl Into<PathBuf>) -> StoreLayout
pub fn stores_dirname(self, name: impl Into<String>) -> StoreLayout
Sourcepub fn stores_root(&self) -> PathBuf
pub fn stores_root(&self) -> PathBuf
The stores parent dir (for host listing/discovery).
pub fn pending_device_pairings_dir(&self) -> PathBuf
pub fn pending_device_pairing_path( &self, session_id: &str, ) -> Result<PathBuf, PathTokenError>
Sourcepub fn pending_device_pairing_journals(
&self,
) -> Result<Vec<(PathBuf, Vec<u8>)>, FileError>
pub fn pending_device_pairing_journals( &self, ) -> Result<Vec<(PathBuf, Vec<u8>)>, FileError>
Read every committed device-pairing journal entry. Atomic-write stages are unpublished files and therefore never enter the durable record set.
Sourcepub fn store_dir(&self, store_id: &str) -> StoreDir
pub fn store_dir(&self, store_id: &str) -> StoreDir
The one (app_dir, store_id) -> StoreDir rule, named with this
layout’s directory. Callers validate an untrusted store_id
(validate_path_token) BEFORE calling, as every
join/restore/create flow already does.
Trait Implementations§
Source§impl Clone for StoreLayout
impl Clone for StoreLayout
Source§fn clone(&self) -> StoreLayout
fn clone(&self) -> StoreLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StoreLayout
impl RefUnwindSafe for StoreLayout
impl Send for StoreLayout
impl Sync for StoreLayout
impl Unpin for StoreLayout
impl UnsafeUnpin for StoreLayout
impl UnwindSafe for StoreLayout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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 moreCreates a shared type from an unshared type.