Skip to main content

KnowledgeStore

Trait KnowledgeStore 

Source
pub trait KnowledgeStore: Send + Sync {
    // Required methods
    fn search<'life0, 'async_trait>(
        &'life0 self,
        params: SearchParams,
    ) -> Pin<Box<dyn Future<Output = Result<SearchResults>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_document<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_references<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        entity: &'life1 str,
        ref_type: Option<&'life2 str>,
        limit: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Reference>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn lookup_bip<'life0, 'async_trait>(
        &'life0 self,
        number: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn lookup_bolt<'life0, 'async_trait>(
        &'life0 self,
        number: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn lookup_blip<'life0, 'async_trait>(
        &'life0 self,
        number: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn lookup_lud<'life0, 'async_trait>(
        &'life0 self,
        number: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn lookup_nut<'life0, 'async_trait>(
        &'life0 self,
        number: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn timeline<'life0, 'life1, 'async_trait>(
        &'life0 self,
        concept: &'life1 str,
        after: Option<DateTime<Utc>>,
        before: Option<DateTime<Utc>>,
    ) -> Pin<Box<dyn Future<Output = Result<Timeline>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_commit<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        repo: Option<&'life2 str>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<CommitContext>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait for querying the Bitcoin Knowledge Base.

Implemented by LocalSqliteStore (direct DB queries) and RemoteApiStore (HTTP client to the BKB service).

Required Methods§

Source

fn search<'life0, 'async_trait>( &'life0 self, params: SearchParams, ) -> Pin<Box<dyn Future<Output = Result<SearchResults>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Full-text (and optionally semantic) search across all documents.

Source

fn get_document<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a single document by ID with full content, references, and concepts.

Source

fn get_references<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, entity: &'life1 str, ref_type: Option<&'life2 str>, limit: u32, ) -> Pin<Box<dyn Future<Output = Result<Vec<Reference>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find all documents referencing a given entity (BIP, BOLT, issue, commit, or concept).

Source

fn lookup_bip<'life0, 'async_trait>( &'life0 self, number: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get comprehensive context for a BIP: spec text, all referencing documents, and incoming refs.

Source

fn lookup_bolt<'life0, 'async_trait>( &'life0 self, number: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get comprehensive context for a BOLT: spec text, all referencing documents, and incoming refs.

Source

fn lookup_blip<'life0, 'async_trait>( &'life0 self, number: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get comprehensive context for a bLIP: spec text, all referencing documents, and incoming refs.

Source

fn lookup_lud<'life0, 'async_trait>( &'life0 self, number: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get comprehensive context for a LUD: spec text, all referencing documents, and incoming refs.

Source

fn lookup_nut<'life0, 'async_trait>( &'life0 self, number: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<DocumentContext>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get comprehensive context for a NUT: spec text, all referencing documents, and incoming refs.

Source

fn timeline<'life0, 'life1, 'async_trait>( &'life0 self, concept: &'life1 str, after: Option<DateTime<Utc>>, before: Option<DateTime<Utc>>, ) -> Pin<Box<dyn Future<Output = Result<Timeline>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Chronological timeline of a concept across all sources.

Source

fn find_commit<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, repo: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Vec<CommitContext>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find commits matching a query, with associated PR and discussion context.

Implementors§