pub struct Store { /* private fields */ }Expand description
The profile store: one canonical registry document under a root dir.
Implementations§
Source§impl Store
impl Store
Sourcepub fn default_root() -> PathBuf
pub fn default_root() -> PathBuf
$VIRTUAL_AGENT_HOME, else ~/.virtual-agent.
Sourcepub fn open(root: impl Into<PathBuf>) -> Result<Self>
pub fn open(root: impl Into<PathBuf>) -> Result<Self>
Open the store at root, creating it (with an empty registry
document) when absent.
pub fn root(&self) -> &Path
Sourcepub fn registry_path(&self) -> PathBuf
pub fn registry_path(&self) -> PathBuf
The canonical registry document awp consumes.
pub fn load(&self) -> Result<RegistryDocument>
Sourcepub fn save(&self, doc: &RegistryDocument) -> Result<()>
pub fn save(&self, doc: &RegistryDocument) -> Result<()>
Validate then atomically persist. A document that fails awp’s registry validation never reaches disk.
Sourcepub fn merge(&self, other: RegistryDocument, force: bool) -> Result<MergeReport>
pub fn merge(&self, other: RegistryDocument, force: bool) -> Result<MergeReport>
Merge other into the stored document. Existing ids are kept
unless force is set; colliding ids collect into conflicts.
Returns the id lists that were overwritten or skipped.
Sourcepub fn export_profile(&self, profile_id: &str) -> Result<RegistryDocument>
pub fn export_profile(&self, profile_id: &str) -> Result<RegistryDocument>
Extract a shareable subset: one profile plus the agent it targets and every binding that names it — the unit users hand around.
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnsafeUnpin for Store
impl UnwindSafe for Store
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
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.