pub struct HarpConnection { /* private fields */ }Implementations§
Source§impl HarpConnection
impl HarpConnection
Sourcepub fn build() -> Result<Self>
pub fn build() -> Result<Self>
Create the harp data directory and data file, read it and deserialize it into the model.
Sourcepub fn save(self) -> Result<()>
pub fn save(self) -> Result<()>
Remember to call this at the end of your mutating harp operations. If you only ever just look at the data rather than modify it, no need to call this.
Sourcepub fn entry_ref(&self, section: &str, register: &str) -> Option<&Vec<String>>
pub fn entry_ref(&self, section: &str, register: &str) -> Option<&Vec<String>>
Get a reference to the Vec of your desired register, but only if both the section and the register already exist.
Sourcepub fn entry_mut(
&mut self,
section: String,
register: String,
) -> &mut Vec<String>
pub fn entry_mut( &mut self, section: String, register: String, ) -> &mut Vec<String>
Get a mutable reference to the Vec of your desired register, creating the section and the register in the process, if necessary.
Trait Implementations§
Source§impl Clone for HarpConnection
impl Clone for HarpConnection
Source§fn clone(&self) -> HarpConnection
fn clone(&self) -> HarpConnection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HarpConnection
impl RefUnwindSafe for HarpConnection
impl Send for HarpConnection
impl Sync for HarpConnection
impl Unpin for HarpConnection
impl UnwindSafe for HarpConnection
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