pub struct Space {
pub root: PathBuf,
}Expand description
Resolves the shared data directory (holding nexus.db) and per-space
directories (spaces/<name>/, each with memory.md + instructions.md).
Fields§
§root: PathBufImplementations§
Source§impl Space
impl Space
Sourcepub fn open() -> Result<Self>
pub fn open() -> Result<Self>
Resolve the data dir, running the one-time layout migration from the old
“single global space” layout (spaces/global/nexus.db) if present.
pub fn db_path(&self) -> PathBuf
Sourcepub fn ensure_space_dir(&self, name: &str) -> Result<()>
pub fn ensure_space_dir(&self, name: &str) -> Result<()>
Ensure spaces/<name>/ exists, for a space just created in the db.
pub fn memory_path(&self, name: &str) -> PathBuf
pub fn instructions_path(&self, name: &str) -> PathBuf
Sourcepub fn blocked_domains_path(&self, name: &str) -> PathBuf
pub fn blocked_domains_path(&self, name: &str) -> PathBuf
Comma-separated domains search(mode=web) always excludes in this space.
Sourcepub fn files_dir(&self, name: &str) -> PathBuf
pub fn files_dir(&self, name: &str) -> PathBuf
Directory holding a space’s imported fileset (created on demand).
Sourcepub fn apps_dir(&self, name: &str) -> PathBuf
pub fn apps_dir(&self, name: &str) -> PathBuf
Directory holding a space’s model-created apps (created on demand).
Sourcepub fn scripts_dir(&self, name: &str) -> PathBuf
pub fn scripts_dir(&self, name: &str) -> PathBuf
Directory holding a space’s reusable scripts.
Sourcepub fn spaces_root(&self) -> PathBuf
pub fn spaces_root(&self) -> PathBuf
Root of all spaces — what the app server serves from.
Sourcepub fn rename_space_dir(&self, old: &str, new: &str) -> Result<()>
pub fn rename_space_dir(&self, old: &str, new: &str) -> Result<()>
Rename a space’s directory (its db row is renamed separately).
Sourcepub fn remove_space_dir(&self, name: &str) -> Result<()>
pub fn remove_space_dir(&self, name: &str) -> Result<()>
Remove a space’s directory (memory + instructions gone with it).
Auto Trait Implementations§
impl Freeze for Space
impl RefUnwindSafe for Space
impl Send for Space
impl Sync for Space
impl Unpin for Space
impl UnsafeUnpin for Space
impl UnwindSafe for Space
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> 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>. Box<dyn Any> can
then be further downcast into Box<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>. Rc<Any> 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.