pub struct GlobalStore { /* private fields */ }Expand description
Global store for managing global knowledge base
Implementations§
Source§impl GlobalStore
impl GlobalStore
Sourcepub fn with_default_path() -> StorageResult<Self>
pub fn with_default_path() -> StorageResult<Self>
Create a new global store with default path resolution
Sourcepub fn initialize(&self) -> StorageResult<()>
pub fn initialize(&self) -> StorageResult<()>
Initialize the global store directory structure
Creates the base directory and all resource subdirectories:
- templates/
- standards/
- specs/
- steering/
- boilerplates/
- rules/
- cache/
Sourcepub fn resource_path(&self, resource_type: ResourceType) -> PathBuf
pub fn resource_path(&self, resource_type: ResourceType) -> PathBuf
Get the path for a resource type
Sourcepub fn store_resource(
&self,
resource_type: ResourceType,
name: &str,
content: &[u8],
) -> StorageResult<PathBuf>
pub fn store_resource( &self, resource_type: ResourceType, name: &str, content: &[u8], ) -> StorageResult<PathBuf>
Store a resource file
Sourcepub fn retrieve_resource(
&self,
resource_type: ResourceType,
name: &str,
) -> StorageResult<Vec<u8>>
pub fn retrieve_resource( &self, resource_type: ResourceType, name: &str, ) -> StorageResult<Vec<u8>>
Retrieve a resource file
Sourcepub fn list_resources(
&self,
resource_type: ResourceType,
) -> StorageResult<Vec<String>>
pub fn list_resources( &self, resource_type: ResourceType, ) -> StorageResult<Vec<String>>
List all resources of a type
Sourcepub fn delete_resource(
&self,
resource_type: ResourceType,
name: &str,
) -> StorageResult<()>
pub fn delete_resource( &self, resource_type: ResourceType, name: &str, ) -> StorageResult<()>
Delete a resource file
Sourcepub fn resource_exists(&self, resource_type: ResourceType, name: &str) -> bool
pub fn resource_exists(&self, resource_type: ResourceType, name: &str) -> bool
Check if a resource exists
Auto Trait Implementations§
impl Freeze for GlobalStore
impl RefUnwindSafe for GlobalStore
impl Send for GlobalStore
impl Sync for GlobalStore
impl Unpin for GlobalStore
impl UnwindSafe for GlobalStore
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