pub struct ValidationUtils;Expand description
Validation utilities for enhanced checking.
Implementations§
Source§impl ValidationUtils
impl ValidationUtils
Sourcepub fn is_valid(table: &SymbolTable) -> bool
pub fn is_valid(table: &SymbolTable) -> bool
Quick validation check (returns true if valid).
§Examples
use tensorlogic_adapters::{SymbolTable, DomainInfo, ValidationUtils};
let mut table = SymbolTable::new();
table.add_domain(DomainInfo::new("Person", 100)).unwrap();
assert!(ValidationUtils::is_valid(&table));Sourcepub fn detailed_validation(table: &SymbolTable) -> Result<ValidationReport>
pub fn detailed_validation(table: &SymbolTable) -> Result<ValidationReport>
Get detailed validation report.
§Examples
use tensorlogic_adapters::{SymbolTable, DomainInfo, ValidationUtils};
let mut table = SymbolTable::new();
table.add_domain(DomainInfo::new("Person", 100)).unwrap();
let report = ValidationUtils::detailed_validation(&table);
assert!(report.is_ok());Sourcepub fn is_domain_used(table: &SymbolTable, domain_name: &str) -> bool
pub fn is_domain_used(table: &SymbolTable, domain_name: &str) -> bool
Check if a specific domain is used.
§Examples
use tensorlogic_adapters::{SymbolTable, DomainInfo, PredicateInfo, ValidationUtils};
let mut table = SymbolTable::new();
table.add_domain(DomainInfo::new("Person", 100)).unwrap();
table.add_predicate(PredicateInfo::new("knows", vec!["Person".to_string()])).unwrap();
assert!(ValidationUtils::is_domain_used(&table, "Person"));
assert!(!ValidationUtils::is_domain_used(&table, "Nonexistent"));Auto Trait Implementations§
impl Freeze for ValidationUtils
impl RefUnwindSafe for ValidationUtils
impl Send for ValidationUtils
impl Sync for ValidationUtils
impl Unpin for ValidationUtils
impl UnwindSafe for ValidationUtils
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