pub struct Gatherbrained { /* private fields */ }
Expand description

An active corpus of gatherbrained ideas.

Implementations§

source§

impl Gatherbrained

source

pub fn new<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Create a new gatherbrained instance by reading and parsing the provided file.

source

pub fn add(&mut self) -> Result<(), Error>

Add to a gatherbrained by invoking $EDITOR.

source

pub fn edit(&mut self, needles: &[&str]) -> Result<(), Error>

Edit all of the gatherbrained entries that match all of the provided needles.

source

pub fn search(&self, needles: &[&str]) -> Result<String, Error>

Search this gatherbrained for entries that match all of the provided needles. Returns a string that represents the selected entries in valid gatherbrained format.

source

pub fn narrate(&self, narratives: &[&str]) -> Result<String, Error>

Narrate the gatherbrained. This will return a string in valid gatherbrained format that corresponds to searching for the needles provided by the narratives. This is shorthand for writing a loop that searches for sets of needles, one after the other.

source

pub fn missing(&self, narratives: &[&str]) -> Result<String, Error>

Construct a valid gatherbrained of entries not currently referred to by any of the provided narratives.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.