pub enum MountStorage {
Folder {
path: PathBuf,
},
GitBranch {
gitdir: PathBuf,
branch: String,
},
Archive {
path: PathBuf,
},
InMemory,
}Expand description
Storage reference for a Mount. One variant per
crate::backend::MemBackend implementation. New backends add
a variant; the file-adapter learns to round-trip it.
Variants§
Folder
Folder backend — mem lives as a directory tree on disk.
The mem root may be the workspace root itself (collapsed
single-mem form: .memstead/config.json at root, no mems/
subfolder) or a sibling mem subfolder.
GitBranch
Git-branch backend — mem lives as a branch in a mem-repo
gitdir. Multi-repo workspaces are supported by varying
gitdir across mounts (see the Storage backend glossary
entry’s per-mount git-repo block for the trade-offs).
Fields
Archive
Archive backend — mem lives inside a sealed .mem zip archive.
Always read-only; mounts of this storage carry
MountCapability::ReadOnly.
InMemory
In-memory backend — mem lives entirely in RAM, with no
filesystem path and no git. Created empty, dropped with the
engine, leaving no on-disk residue. Serves ephemeral
per-session playground mems. Carries no fields: there is
nothing to locate on disk, and the backend holds all state
itself (see crate::storage::InMemoryBackend).
Implementations§
Source§impl MountStorage
impl MountStorage
Sourcepub fn backend_id(&self) -> &'static str
pub fn backend_id(&self) -> &'static str
Stable kebab-case backend identifier surfaced in error envelopes
(e.g. MARKDOWN_EXPORT_UNSUPPORTED_BACKEND’s active_backend
detail) and in the on-disk mounts.json serialisation. The
kebab-case form matches the MountStorageWire #[serde(tag, rename_all = "kebab-case")] tag.
Sourcepub fn is_durable(&self) -> bool
pub fn is_durable(&self) -> bool
Whether writes (and, for read-only backends, the loaded content)
survive process restart / session-TTL eviction. Folder,
GitBranch, and Archive all live on disk and persist; only
InMemory is volatile — its state is dropped with the engine,
so a commit_sha it returns denotes nothing durable. This is the
fact the durability marker projects: derived from the storage
kind, not from current_head() (which is None for both
Folder and InMemory and so cannot tell them apart).
Trait Implementations§
Source§impl Clone for MountStorage
impl Clone for MountStorage
Source§fn clone(&self) -> MountStorage
fn clone(&self) -> MountStorage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MountStorage
impl Debug for MountStorage
impl Eq for MountStorage
Source§impl PartialEq for MountStorage
impl PartialEq for MountStorage
impl StructuralPartialEq for MountStorage
Auto Trait Implementations§
impl Freeze for MountStorage
impl RefUnwindSafe for MountStorage
impl Send for MountStorage
impl Sync for MountStorage
impl Unpin for MountStorage
impl UnsafeUnpin for MountStorage
impl UnwindSafe for MountStorage
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
key and return true if they are equal.impl<T> Fruit for T
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