pub trait Column: Mapping {
// Required method
fn iter(&self) -> impl Iterator<Item = (Self::Dom, &Self::Cod)>;
// Provided methods
fn values(&self) -> impl Iterator<Item = &Self::Cod> { ... }
fn preimage(&self, y: &Self::Cod) -> impl Iterator<Item = Self::Dom> { ... }
fn is_empty(&self) -> bool { ... }
}
Expand description
A mapping with finite support.
While its domain and codomain can be infinite, such a mapping is defined at only finitely many values in the domain. It is thus a “column of data”, as found in data tables and relational databases.
Required Methods§
Provided Methods§
Sourcefn preimage(&self, y: &Self::Cod) -> impl Iterator<Item = Self::Dom>
fn preimage(&self, y: &Self::Cod) -> impl Iterator<Item = Self::Dom>
Computes the preimage of the mapping at a value in the codomain.
Depending on whether the implementation maintains a reverse index for the mapping, this method will take time linear in the size of the preimage or the size of the whole column.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.