pub struct ComputedDomainRegistry { /* private fields */ }Expand description
Registry for managing computed domains.
The registry tracks computed domains and their dependencies, enabling lazy evaluation and caching.
Implementations§
Source§impl ComputedDomainRegistry
impl ComputedDomainRegistry
Sourcepub fn register(&mut self, domain: ComputedDomain) -> Result<(), AdapterError>
pub fn register(&mut self, domain: ComputedDomain) -> Result<(), AdapterError>
Register a computed domain.
§Examples
use tensorlogic_adapters::{ComputedDomainRegistry, ComputedDomain, DomainComputation};
let mut registry = ComputedDomainRegistry::new();
let domain = ComputedDomain::new(
"Adults",
DomainComputation::Filter {
base: "Person".to_string(),
predicate: "is_adult".to_string(),
}
);
registry.register(domain).unwrap();Sourcepub fn get(&self, name: &str) -> Option<&ComputedDomain>
pub fn get(&self, name: &str) -> Option<&ComputedDomain>
Get a computed domain by name.
Sourcepub fn get_mut(&mut self, name: &str) -> Option<&mut ComputedDomain>
pub fn get_mut(&mut self, name: &str) -> Option<&mut ComputedDomain>
Get a mutable reference to a computed domain.
Sourcepub fn list(&self) -> Vec<&ComputedDomain>
pub fn list(&self) -> Vec<&ComputedDomain>
List all registered computed domains.
Sourcepub fn remove(&mut self, name: &str) -> Option<ComputedDomain>
pub fn remove(&mut self, name: &str) -> Option<ComputedDomain>
Remove a computed domain from the registry.
Sourcepub fn validate_all(&self, table: &SymbolTable) -> Result<(), Vec<AdapterError>>
pub fn validate_all(&self, table: &SymbolTable) -> Result<(), Vec<AdapterError>>
Validate all computed domains against a symbol table.
Trait Implementations§
Source§impl Clone for ComputedDomainRegistry
impl Clone for ComputedDomainRegistry
Source§fn clone(&self) -> ComputedDomainRegistry
fn clone(&self) -> ComputedDomainRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComputedDomainRegistry
impl Debug for ComputedDomainRegistry
Source§impl Default for ComputedDomainRegistry
impl Default for ComputedDomainRegistry
Source§fn default() -> ComputedDomainRegistry
fn default() -> ComputedDomainRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ComputedDomainRegistry
impl RefUnwindSafe for ComputedDomainRegistry
impl Send for ComputedDomainRegistry
impl Sync for ComputedDomainRegistry
impl Unpin for ComputedDomainRegistry
impl UnwindSafe for ComputedDomainRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more