pub struct MemoryLayout { /* private fields */ }Expand description
Roots for the global scope and one workspace scope.
Implementations§
Source§impl MemoryLayout
impl MemoryLayout
Sourcepub fn at(
memory_root: &Path,
workspace_root: &Path,
) -> Result<MemoryLayout, DurableMemoryError>
pub fn at( memory_root: &Path, workspace_root: &Path, ) -> Result<MemoryLayout, DurableMemoryError>
Builds a layout under an explicit memory root.
memory_root is the directory that contains global/ and
workspaces/. workspace_root is the project directory whose canonical
path selects the workspace scope.
Sourcepub fn from_env(
workspace_root: &Path,
) -> Result<MemoryLayout, DurableMemoryError>
pub fn from_env( workspace_root: &Path, ) -> Result<MemoryLayout, DurableMemoryError>
Resolves the layout from HOME and XDG_DATA_HOME.
An absolute XDG_DATA_HOME wins. Otherwise the root is
$HOME/.local/share/merry/memory.
Sourcepub fn memory_root_from_env() -> Result<PathBuf, DurableMemoryError>
pub fn memory_root_from_env() -> Result<PathBuf, DurableMemoryError>
Directory that contains global/ and workspaces/.
An absolute XDG_DATA_HOME wins. On Windows, falls back to
%LOCALAPPDATA%/merry/memory or <home>/AppData/Local/merry/memory.
On Unix, falls back to $HOME/.local/share/merry/memory.
pub fn root(&self) -> &Path
pub fn global_dir(&self) -> &Path
pub fn workspace_dir(&self) -> &Path
pub fn workspace_id(&self) -> &str
Trait Implementations§
Source§impl Clone for MemoryLayout
impl Clone for MemoryLayout
Source§fn clone(&self) -> MemoryLayout
fn clone(&self) -> MemoryLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryLayout
impl Debug for MemoryLayout
impl Eq for MemoryLayout
Source§impl PartialEq for MemoryLayout
impl PartialEq for MemoryLayout
impl StructuralPartialEq for MemoryLayout
Auto Trait Implementations§
impl Forget for MemoryLayout
impl Freeze for MemoryLayout
impl Move for MemoryLayout
impl RefUnwindSafe for MemoryLayout
impl Send for MemoryLayoutwhere
RawVecInner: Send,
impl Sync for MemoryLayoutwhere
RawVecInner: Sync,
impl Unpin for MemoryLayout
impl UnsafeUnpin for MemoryLayout
impl UnwindSafe for MemoryLayoutwhere
RawVecInner: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.