pub struct BondManager { /* private fields */ }Expand description
SQLite-backed manager for Bonds.
Keep this file as the module root and shared type definition. Concern-specific method implementations live in sibling modules.
Implementations§
Source§impl BondManager
Health-scan concerns.
impl BondManager
Health-scan concerns.
Source§impl BondManager
Hook registration and dispatch concerns.
impl BondManager
Hook registration and dispatch concerns.
Sourcepub fn register_hook<H>(&self, hook: H)where
H: BondEventHook + 'static,
pub fn register_hook<H>(&self, hook: H)where
H: BondEventHook + 'static,
Register closure/type-based hook.
Sourcepub fn register_hook_arc(&self, hook: Arc<dyn BondEventHook>)
pub fn register_hook_arc(&self, hook: Arc<dyn BondEventHook>)
Register Arc-wrapped hook implementation.
Source§impl BondManager
Create/update/delete and metadata mutation flows.
impl BondManager
Create/update/delete and metadata mutation flows.
Sourcepub fn create_bond<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
source: P,
target: Q,
name: Option<String>,
) -> Result<Bond, BondError>
pub fn create_bond<P: AsRef<Path>, Q: AsRef<Path>>( &self, source: P, target: Q, name: Option<String>, ) -> Result<Bond, BondError>
Create a symlink bond and persist it (no metadata).
Sourcepub fn create_bond_with_metadata<P: AsRef<Path>, Q: AsRef<Path>>(
&self,
source: P,
target: Q,
name: Option<String>,
metadata: Option<HashMap<String, String>>,
) -> Result<Bond, BondError>
pub fn create_bond_with_metadata<P: AsRef<Path>, Q: AsRef<Path>>( &self, source: P, target: Q, name: Option<String>, metadata: Option<HashMap<String, String>>, ) -> Result<Bond, BondError>
Create a symlink bond with metadata and persist it.
Sourcepub fn update_bond(
&self,
id: &str,
new_source: Option<PathBuf>,
new_target: Option<PathBuf>,
new_name: Option<String>,
) -> Result<Bond, BondError>
pub fn update_bond( &self, id: &str, new_source: Option<PathBuf>, new_target: Option<PathBuf>, new_name: Option<String>, ) -> Result<Bond, BondError>
Update source and/or target and/or name.
Source§impl BondManager
Query and filtering concerns.
impl BondManager
Query and filtering concerns.
Sourcepub fn query_bonds(&self, query: &BondQuery) -> Result<Vec<Bond>, BondError>
pub fn query_bonds(&self, query: &BondQuery) -> Result<Vec<Bond>, BondError>
Query bonds using optional source/target/metadata filters (AND semantics).
pub fn query_by_source<P: AsRef<Path>>( &self, source: P, ) -> Result<Vec<Bond>, BondError>
pub fn query_by_target<P: AsRef<Path>>( &self, target: P, ) -> Result<Vec<Bond>, BondError>
pub fn query_by_metadata_key(&self, key: &str) -> Result<Vec<Bond>, BondError>
pub fn query_by_metadata( &self, key: &str, value: &str, ) -> Result<Vec<Bond>, BondError>
Auto Trait Implementations§
impl !Freeze for BondManager
impl !RefUnwindSafe for BondManager
impl Send for BondManager
impl !Sync for BondManager
impl Unpin for BondManager
impl UnsafeUnpin for BondManager
impl !UnwindSafe for BondManager
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