pub struct WorkspaceManifest {
pub version: u32,
pub workspace: String,
pub mode: BrainMode,
pub main_id: String,
pub scopes: Vec<ScopeDef>,
pub discovery: DiscoveryOptions,
}Expand description
Versioned .brain/workspace.json manifest.
Fields§
§version: u32Manifest format version (2 = scopes).
workspace: StringAbsolute or display path of workspace root.
mode: BrainModeSingle vs multi-brain.
main_id: StringMainBrain id (always present conceptually; default main).
scopes: Vec<ScopeDef>SubBrain definitions (never includes main itself).
discovery: DiscoveryOptionsDiscovery toggles.
Implementations§
Source§impl WorkspaceManifest
impl WorkspaceManifest
Sourcepub fn single(workspace: &Path) -> Self
pub fn single(workspace: &Path) -> Self
New single-mode marker (compatible with older tiny markers).
Sourcepub fn resolve_scope(&self, rel_path: &str) -> String
pub fn resolve_scope(&self, rel_path: &str) -> String
Resolve owner scope for a workspace-relative path (/-separated).
Longest matching SubBrain root wins; otherwise MainBrain.
In single mode always returns MAIN_SCOPE.
Sourcepub fn find_scope(&self, id_or_alias: &str) -> Option<&ScopeDef>
pub fn find_scope(&self, id_or_alias: &str) -> Option<&ScopeDef>
Look up a SubBrain by id or alias.
Sourcepub fn find_scope_mut(&mut self, id_or_alias: &str) -> Option<&mut ScopeDef>
pub fn find_scope_mut(&mut self, id_or_alias: &str) -> Option<&mut ScopeDef>
Mut look up.
Sourcepub fn all_scope_ids(&self) -> Vec<String>
pub fn all_scope_ids(&self) -> Vec<String>
All known scope ids including main.
Trait Implementations§
Source§impl Clone for WorkspaceManifest
impl Clone for WorkspaceManifest
Source§fn clone(&self) -> WorkspaceManifest
fn clone(&self) -> WorkspaceManifest
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 WorkspaceManifest
impl Debug for WorkspaceManifest
Source§impl<'de> Deserialize<'de> for WorkspaceManifest
impl<'de> Deserialize<'de> for WorkspaceManifest
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for WorkspaceManifest
impl PartialEq for WorkspaceManifest
Source§impl Serialize for WorkspaceManifest
impl Serialize for WorkspaceManifest
impl StructuralPartialEq for WorkspaceManifest
Auto Trait Implementations§
impl Freeze for WorkspaceManifest
impl RefUnwindSafe for WorkspaceManifest
impl Send for WorkspaceManifest
impl Sync for WorkspaceManifest
impl Unpin for WorkspaceManifest
impl UnsafeUnpin for WorkspaceManifest
impl UnwindSafe for WorkspaceManifest
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