pub enum AnyTuple {
Uni(UniTuple),
Bi(BiTuple),
Tri(TriTuple),
Quad(QuadTuple),
Penta(PentaTuple),
}Variants§
Implementations§
Source§impl AnyTuple
impl AnyTuple
Sourcepub fn combine(&self, other: &AnyTuple) -> Result<AnyTuple>
pub fn combine(&self, other: &AnyTuple) -> Result<AnyTuple>
OPTIMIZATION: Combine tuples without creating an intermediate Vec. This is more verbose but avoids a heap allocation on every join.
Sourcepub fn facts_vec(&self) -> SmallVec<[Rc<dyn GreynetFact>; 5]>
pub fn facts_vec(&self) -> SmallVec<[Rc<dyn GreynetFact>; 5]>
High-performance version that returns a stack-allocated SmallVec.
Sourcepub fn facts(&self) -> Vec<Rc<dyn GreynetFact>>
pub fn facts(&self) -> Vec<Rc<dyn GreynetFact>>
Compatibility version - use facts_iter() or facts_vec() for better performance.
pub fn arity(&self) -> usize
pub fn node(&self) -> Option<NodeId>
pub fn set_node(&mut self, node_id: NodeId)
pub fn state(&self) -> TupleState
pub fn set_state(&mut self, state: TupleState)
pub fn reset(&mut self)
pub fn tuple_arity(&self) -> TupleArity
Trait Implementations§
Source§impl FactIterator for AnyTuple
impl FactIterator for AnyTuple
type Iter<'a> = Box<dyn Iterator<Item = &'a (dyn GreynetFact + 'static)> + 'a>
fn facts_iter(&self) -> Self::Iter<'_>
Source§impl ZeroCopyFacts for AnyTuple
impl ZeroCopyFacts for AnyTuple
Source§fn get_fact_ref(&self, index: usize) -> Option<&dyn GreynetFact>
fn get_fact_ref(&self, index: usize) -> Option<&dyn GreynetFact>
Get a direct reference to a fact by index without any allocations
fn as_any(&self) -> &dyn Any
Source§fn first_fact(&self) -> Option<&dyn GreynetFact>
fn first_fact(&self) -> Option<&dyn GreynetFact>
Get the first fact (optimized common case)
Source§fn last_fact(&self) -> Option<&dyn GreynetFact>
fn last_fact(&self) -> Option<&dyn GreynetFact>
Get the last fact (optimized common case)
Source§fn has_fact_at(&self, index: usize) -> bool
fn has_fact_at(&self, index: usize) -> bool
Check if index is valid for this tuple
Auto Trait Implementations§
impl Freeze for AnyTuple
impl !RefUnwindSafe for AnyTuple
impl !Send for AnyTuple
impl !Sync for AnyTuple
impl Unpin for AnyTuple
impl !UnwindSafe for AnyTuple
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