Skip to main content

KnowledgeStore

Trait KnowledgeStore 

Source
pub trait KnowledgeStore: Send + Sync {
    // Required methods
    fn id(&self) -> KnowledgeStoreId;
    fn save<'life0, 'async_trait>(
        &'life0 self,
        request: KnowledgeSaveRequest,
    ) -> Pin<Box<dyn Future<Output = Result<KnowledgeDocument>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 KnowledgeDocId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<KnowledgeDocument>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_revision<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 KnowledgeDocId,
        revision: u32,
    ) -> Pin<Box<dyn Future<Output = Result<Option<KnowledgeDocument>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
        query: KnowledgeListQuery,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<KnowledgeDocSummary>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search<'life0, 'async_trait>(
        &'life0 self,
        query: KnowledgeQuery,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<KnowledgeSearchResult>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update<'life0, 'async_trait>(
        &'life0 self,
        request: KnowledgeUpdateRequest,
    ) -> Pin<Box<dyn Future<Output = Result<KnowledgeDocument>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn archive<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 KnowledgeDocId,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set_link<'life0, 'async_trait>(
        &'life0 self,
        request: KnowledgeLinkRequest,
    ) -> Pin<Box<dyn Future<Output = Result<KnowledgeDocument>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn revisions<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 KnowledgeDocId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<KnowledgeRevisionInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn id(&self) -> KnowledgeStoreId

Source

fn save<'life0, 'async_trait>( &'life0 self, request: KnowledgeSaveRequest, ) -> Pin<Box<dyn Future<Output = Result<KnowledgeDocument>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

fn get_revision<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 KnowledgeDocId, revision: u32, ) -> Pin<Box<dyn Future<Output = Result<Option<KnowledgeDocument>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn list<'life0, 'async_trait>( &'life0 self, query: KnowledgeListQuery, ) -> Pin<Box<dyn Future<Output = Result<Vec<KnowledgeDocSummary>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn search<'life0, 'async_trait>( &'life0 self, query: KnowledgeQuery, ) -> Pin<Box<dyn Future<Output = Result<Vec<KnowledgeSearchResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn update<'life0, 'async_trait>( &'life0 self, request: KnowledgeUpdateRequest, ) -> Pin<Box<dyn Future<Output = Result<KnowledgeDocument>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn archive<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 KnowledgeDocId, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Soft-delete: the document leaves default lists but stays readable by id.

Source

fn revisions<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 KnowledgeDocId, ) -> Pin<Box<dyn Future<Output = Result<Vec<KnowledgeRevisionInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§