evo_framework 2025.2.51300

Evo(lution) framework: A powerful framework designed for ai
Documentation
use crate::framework::entity::i_entity::IEntity;
use crate::framework::i_query::IQuery;
use std::fmt;
use std::fmt::Debug;
use std::hash::Hash;

/// Core trait for foundational operations within the Evo namespace.
/// Governs setting, retrieving, and managing entity collections.
pub trait IFoundation {
    /// Sets an entity in the foundation using the entity's ID.
    ///
    /// # Arguments
    ///
    /// * `entity`: An implementation of the `IEntity` trait that defines the entity being set.
    fn do_set<K, V>(&mut self, entity: V)
    where
        K: std::cmp::Eq + std::hash::Hash + Clone + fmt::Debug,
        V: IEntity<K> + Clone + fmt::Debug
    ;

    fn do_set_with_id<K, V>(&mut self, id: K, entity: V)
    where
        K: std::cmp::Eq + std::hash::Hash + Clone + fmt::Debug,
        V: IEntity<K> + Clone + fmt::Debug
    ;

    fn do_get<K, V>(&self, id: &K) -> Option<V>
    where
        K: std::cmp::Eq + std::hash::Hash + Clone + fmt::Debug,
        V: IEntity<K> + Clone + fmt::Debug
    ;

    fn do_query<K, V, Q>(&self, query: &Q) -> Vec<V>
    where
        K: std::cmp::Eq + std::hash::Hash + Clone + fmt::Debug,
        V: IEntity<K> + Clone + fmt::Debug,
        Q: IQuery<K, V>
    ;

    fn do_del<K,V>(&mut self, id: &K)
    where
        K: Eq + Hash + Clone + Debug,
        V: IEntity<K> + Clone + Debug
    ;
}