pub struct BondManager { /* private fields */ }Expand description
SQLite-backed manager for Bonds.
Implementations§
Source§impl BondManager
impl BondManager
Sourcepub fn new(db_path: Option<PathBuf>) -> Result<Self, BondError>
pub fn new(db_path: Option<PathBuf>) -> Result<Self, BondError>
Open (or create) the DB at db_path. If None, defaults to $HOME/.bonds/bonds.db.
Sourcepub fn get_bond(&self, identifier: &str) -> Result<Bond, BondError>
pub fn get_bond(&self, identifier: &str) -> Result<Bond, BondError>
Get a single bond by ID or name. ID can be a unique prefix.
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.
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