KnowledgeBaseInterface

Trait KnowledgeBaseInterface 

Source
pub trait KnowledgeBaseInterface: KnowledgeBase {
    // Required methods
    fn insert(
        &self,
        collection: impl Into<String>,
        key: impl Into<String>,
        data: &impl Serialize,
    ) -> Result<()>;
    fn retrieve<T: DeserializeOwned>(
        &self,
        collection: impl Into<String>,
        key: impl Into<String>,
    ) -> Result<T>;
}
Expand description

High level interface to the knowledge base

Required Methods§

Source

fn insert( &self, collection: impl Into<String>, key: impl Into<String>, data: &impl Serialize, ) -> Result<()>

Insert a serializable object

Source

fn retrieve<T: DeserializeOwned>( &self, collection: impl Into<String>, key: impl Into<String>, ) -> Result<T>

Retrieve and deserialize object

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<TKnowledgeBase: ?Sized + KnowledgeBase> KnowledgeBaseInterface for TKnowledgeBase