[−][src]Struct gooseberry::gooseberry::Gooseberry
Gooseberry database, API client, and configuration
Implementations
impl Gooseberry
[src]
Database
sled
database related functions to create, manipulate, and retrieve information in
the annotation ID: (tags IDs) tree and the tag ID: (annotation IDs) tree.
Also stores and updates the time of the last sync.
pub fn get_db(db_dir: &Path) -> Result<Db>
[src]
Gets the sled
database with all gooseberry info.
Makes a new one the first time round
pub fn set_merge(&self) -> Result<()>
[src]
Merge function for appending items to an existing key, uses semicolons
pub fn reset_sync_time(&self) -> Result<()>
[src]
(re)sets time of last sync to way in the past
pub fn set_sync_time(&self, datetime: &str) -> Result<()>
[src]
Update last sync time after sync
pub fn get_sync_time(&self) -> Result<String>
[src]
Get time of last sync
pub fn annotation_to_tags(&self) -> Result<Tree>
[src]
Tree storing annotation id: (tags ...) Referred to as the annotation tree
pub fn tag_to_annotations(&self) -> Result<Tree>
[src]
Tree storing tag: ( annotation IDs ...) Referred to as the tags tree
pub fn add_to_tag(&self, tag_key: &[u8], annotation_key: &[u8]) -> Result<()>
[src]
pub fn add_annotation(
&self,
annotation: &Annotation,
annotation_batch: &mut Batch
) -> Result<()>
[src]
&self,
annotation: &Annotation,
annotation_batch: &mut Batch
) -> Result<()>
Add an annotation to both trees
pub fn sync_annotations(
&self,
annotations: &[Annotation]
) -> Result<(usize, usize, usize)>
[src]
&self,
annotations: &[Annotation]
) -> Result<(usize, usize, usize)>
add or update annotations from the Hypothesis API
pub fn delete_from_tag(&self, tag_key: &[u8], annotation_id: &str) -> Result<()>
[src]
Delete an annotation index from the tag tree
pub fn delete_from_annotations(&self, id: &str) -> Result<Vec<String>>
[src]
Delete an annotation ID from the annotation tree
pub fn delete_annotation(&self, id: &str) -> Result<Vec<String>>
[src]
Delete annotation from database
pub fn delete_annotations(&self, ids: &[String]) -> Result<Vec<Vec<String>>>
[src]
Delete multiple annotations
pub fn get_tagged_annotations(&self, tag: &str) -> Result<Vec<String>>
[src]
Retrieve annotations tagged with a given tag
pub fn get_annotation_tags(&self, id: &str) -> Result<Vec<String>>
[src]
Retrieve tags associated with an annotation
impl Gooseberry
[src]
Markdown generation
functions related to generating the mdBook
wiki
impl Gooseberry
[src]
Search
skim
search window functions
pub async fn search(
&self,
annotations: Vec<Annotation>,
hbs: &Handlebars<'_>,
fuzzy: bool
) -> Result<()>
[src]
&self,
annotations: Vec<Annotation>,
hbs: &Handlebars<'_>,
fuzzy: bool
) -> Result<()>
Makes a skim search window for given annotations
pub fn search_group(
annotations: &[Annotation],
hbs: &Handlebars<'_>,
fuzzy: bool
) -> Result<HashSet<String>>
[src]
annotations: &[Annotation],
hbs: &Handlebars<'_>,
fuzzy: bool
) -> Result<HashSet<String>>
Makes a skim search window for given annotations from an external group
impl Gooseberry
[src]
CLI
Functions related to handling CLI commands
pub async fn start(cli: GooseberryCLI) -> Result<()>
[src]
Initialize program with command line input.
Reads sled
trees and metadata file from the locations specified in config.
(makes new ones the first time).
pub async fn run(&mut self, cli: GooseberryCLI) -> Result<()>
[src]
Run knowledge-base related functions
pub async fn sync(&self) -> Result<()>
[src]
Sync newly added / updated annotations
pub async fn sync_group(
&self,
group_id: String,
filters: Filters,
search: bool,
fuzzy: bool
) -> Result<()>
[src]
&self,
group_id: String,
filters: Filters,
search: bool,
fuzzy: bool
) -> Result<()>
Move (optionally filtered) annotations from a different group to the group gooseberry looks at (set in config)
pub async fn filter_annotations(
&self,
filters: Filters,
group: Option<String>
) -> Result<Vec<Annotation>>
[src]
&self,
filters: Filters,
group: Option<String>
) -> Result<Vec<Annotation>>
Filter annotations based on command-line flags
pub async fn tag(
&self,
annotations: Vec<Annotation>,
delete: bool,
tag: Option<String>
) -> Result<()>
[src]
&self,
annotations: Vec<Annotation>,
delete: bool,
tag: Option<String>
) -> Result<()>
Tag a filtered set of annotations with a given tag
pub async fn delete(
&self,
annotations: Vec<Annotation>,
hypothesis: bool,
force: bool
) -> Result<()>
[src]
&self,
annotations: Vec<Annotation>,
hypothesis: bool,
force: bool
) -> Result<()>
Delete filtered annotations from gooseberry (by adding an ignore tag) or also from Hypothesis
pub async fn view(&self, filters: Filters, id: Option<String>) -> Result<()>
[src]
View optionally filtered annotations in the terminal
pub fn clear(&self, force: bool) -> Result<()>
[src]
Removes all sled
trees
Deletes everything in the db_dir
Auto Trait Implementations
impl !RefUnwindSafe for Gooseberry
[src]
impl Send for Gooseberry
[src]
impl Sync for Gooseberry
[src]
impl Unpin for Gooseberry
[src]
impl !UnwindSafe for Gooseberry
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
[src]
T: Any,
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<D> OwoColorize for D
pub fn fg<C>(&'a self) -> FgColorDisplay<'a, C, Self> where
C: Color,
C: Color,
pub fn bg<C>(&'a self) -> BgColorDisplay<'a, C, Self> where
C: Color,
C: Color,
pub fn black(&'a self) -> FgColorDisplay<'a, Black, Self>
pub fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
pub fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
pub fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
pub fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
pub fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
pub fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
pub fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
pub fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
pub fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
pub fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
pub fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
pub fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
pub fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
pub fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
pub fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
pub fn white(&'a self) -> FgColorDisplay<'a, White, Self>
pub fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
pub fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
pub fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
pub fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
pub fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
pub fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
pub fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
pub fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
pub fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
pub fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
pub fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
pub fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
pub fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
pub fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
pub fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
pub fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
pub fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
pub fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
pub fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
pub fn bold(&'a self) -> BoldDisplay<'a, Self>
pub fn dimmed(&'a self) -> DimDisplay<'a, Self>
pub fn italic(&'a self) -> ItalicDisplay<'a, Self>
pub fn underline(&'a self) -> UnderlineDisplay<'a, Self>
pub fn blink(&'a self) -> BlinkDisplay<'a, Self>
pub fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
pub fn reversed(&'a self) -> ReversedDisplay<'a, Self>
pub fn hidden(&'a self) -> HiddenDisplay<'a, Self>
pub fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>
pub fn color<Color>(
&'a self,
color: Color
) -> FgDynColorDisplay<'a, Color, Self> where
Color: DynColor,
&'a self,
color: Color
) -> FgDynColorDisplay<'a, Color, Self> where
Color: DynColor,
pub fn on_color<Color>(
&'a self,
color: Color
) -> BgDynColorDisplay<'a, Color, Self> where
Color: DynColor,
&'a self,
color: Color
) -> BgDynColorDisplay<'a, Color, Self> where
Color: DynColor,
pub fn truecolor(
&'a self,
r: u8,
g: u8,
b: u8
) -> FgDynColorDisplay<'a, Rgb, Self>
&'a self,
r: u8,
g: u8,
b: u8
) -> FgDynColorDisplay<'a, Rgb, Self>
pub fn on_truecolor(
&'a self,
r: u8,
g: u8,
b: u8
) -> BgDynColorDisplay<'a, Rgb, Self>
&'a self,
r: u8,
g: u8,
b: u8
) -> BgDynColorDisplay<'a, Rgb, Self>
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,