pub struct WorkspaceConfig {
pub format: u32,
pub name: String,
pub schema: SchemaRef,
pub version: Option<Version>,
pub description: Option<String>,
pub authors: Option<Vec<String>>,
pub deps: Vec<DepRef>,
}Expand description
Workspace-shape .memstead/config.json for a filesystem mem. Distinct
from PublishedMemConfig (the archive shape).
Fields§
§format: u32Format integer. Always FILESYSTEM_WORKSPACE_FORMAT on
successful load.
name: StringMem slug — path-derived under the unified layout. The mem’s identity
of record lives in the mounts roster (state/mounts.json); the engine no
longer writes name into config.json (the schema validator tombstones a
stray name), so it is omitted on serialize and, when absent on read,
filled from the workspace-root basename by read_workspace_config.
schema: SchemaRefSchema pin. Exact <name>@<version> only — bare-name pins are
rejected at parse.
version: Option<Version>Mem version, used by memstead publish. Optional in the
workspace shape; required when publishing.
description: Option<String>Optional human-readable description.
Optional author list.
deps: Vec<DepRef>Cross-mem dependencies. Order preserved; duplicates rejected at parse time.
Implementations§
Source§impl WorkspaceConfig
impl WorkspaceConfig
Sourcepub fn new(name: impl Into<String>, schema: SchemaRef) -> Self
pub fn new(name: impl Into<String>, schema: SchemaRef) -> Self
Build a fresh workspace config with format set to
FILESYSTEM_WORKSPACE_FORMAT, the engine default version
(0.1.0), and an empty deps list. Convenience for memstead init.
F1: every mem carries a populated version from creation
onward — operators bump via memstead mem set-version before
publishing.
Sourcepub fn add_dep(&mut self, dep: DepRef) -> bool
pub fn add_dep(&mut self, dep: DepRef) -> bool
Add a dep entry to the list. Idempotent — re-adding an existing
dep is a no-op so memstead link can be invoked twice in a row
without producing a duplicate. Returns true when the entry
was newly added, false when it was already present.
Sourcepub fn to_published(&self) -> Result<PublishedMemConfig, PublishConversionError>
pub fn to_published(&self) -> Result<PublishedMemConfig, PublishConversionError>
Project the workspace config to the strict archive shape used
by sealed .mem archives. Drops deps and applies the same
requirements as memstead_schema::published_config_from
(versioned schema, present version).
Trait Implementations§
Source§impl Clone for WorkspaceConfig
impl Clone for WorkspaceConfig
Source§fn clone(&self) -> WorkspaceConfig
fn clone(&self) -> WorkspaceConfig
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 WorkspaceConfig
impl Debug for WorkspaceConfig
Source§impl<'de> Deserialize<'de> for WorkspaceConfig
impl<'de> Deserialize<'de> for WorkspaceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for WorkspaceConfig
Source§impl PartialEq for WorkspaceConfig
impl PartialEq for WorkspaceConfig
Source§impl Serialize for WorkspaceConfig
impl Serialize for WorkspaceConfig
impl StructuralPartialEq for WorkspaceConfig
Auto Trait Implementations§
impl Freeze for WorkspaceConfig
impl RefUnwindSafe for WorkspaceConfig
impl Send for WorkspaceConfig
impl Sync for WorkspaceConfig
impl Unpin for WorkspaceConfig
impl UnsafeUnpin for WorkspaceConfig
impl UnwindSafe for WorkspaceConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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