Skip to main content

relmath/traits/
finite_relation.rs

1//! Shared trait for finite relations.
2
3/// A finite relation that can report the number of stored tuples.
4pub trait FiniteRelation {
5    /// Returns the number of stored tuples in the relation.
6    fn len(&self) -> usize;
7
8    /// Returns `true` when the relation contains no tuples.
9    fn is_empty(&self) -> bool {
10        self.len() == 0
11    }
12}