pub struct FunctionalDependencies { /* private fields */ }
Expand description
This object encapsulates all functional dependencies in a given relation.
Implementations§
source§impl FunctionalDependencies
impl FunctionalDependencies
sourcepub fn new(dependencies: Vec<FunctionalDependence>) -> Self
pub fn new(dependencies: Vec<FunctionalDependence>) -> Self
Creates a new FunctionalDependencies
object from a vector of
FunctionalDependence
objects.
sourcepub fn new_from_constraints(
constraints: Option<&Constraints>,
n_field: usize
) -> Self
pub fn new_from_constraints( constraints: Option<&Constraints>, n_field: usize ) -> Self
Creates a new FunctionalDependencies
object from the given constraints.
pub fn with_dependency(self, mode: Dependency) -> Self
sourcepub fn extend(&mut self, other: FunctionalDependencies)
pub fn extend(&mut self, other: FunctionalDependencies)
Merges the given functional dependencies with these.
sourcepub fn add_offset(&mut self, offset: usize)
pub fn add_offset(&mut self, offset: usize)
Adds the offset
value to source_indices
and target_indices
for
each functional dependency.
sourcepub fn project_functional_dependencies(
&self,
proj_indices: &[usize],
n_out: usize
) -> FunctionalDependencies
pub fn project_functional_dependencies( &self, proj_indices: &[usize], n_out: usize ) -> FunctionalDependencies
Updates source_indices
and target_indices
of each functional
dependence using the index mapping given in proj_indices
.
Assume that proj_indices
is [2, 5, 8] and we have a functional
dependence [5] (source_indices
) -> [5, 8] (target_indices
).
In the updated schema, fields at indices [2, 5, 8] will transform
to [0, 1, 2]. Therefore, the resulting functional dependence will
be [1] -> [1, 2].
sourcepub fn join(
&self,
other: &FunctionalDependencies,
join_type: &JoinType,
left_cols_len: usize
) -> FunctionalDependencies
pub fn join( &self, other: &FunctionalDependencies, join_type: &JoinType, left_cols_len: usize ) -> FunctionalDependencies
This function joins this set of functional dependencies with the other
according to the given join_type
.
sourcepub fn extend_target_indices(&mut self, n_out: usize)
pub fn extend_target_indices(&mut self, n_out: usize)
This function ensures that functional dependencies involving uniquely occuring determinant keys cover their entire table in terms of dependent columns.
Trait Implementations§
source§impl Clone for FunctionalDependencies
impl Clone for FunctionalDependencies
source§fn clone(&self) -> FunctionalDependencies
fn clone(&self) -> FunctionalDependencies
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for FunctionalDependencies
impl Debug for FunctionalDependencies
source§impl PartialEq<FunctionalDependencies> for FunctionalDependencies
impl PartialEq<FunctionalDependencies> for FunctionalDependencies
source§fn eq(&self, other: &FunctionalDependencies) -> bool
fn eq(&self, other: &FunctionalDependencies) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for FunctionalDependencies
impl StructuralEq for FunctionalDependencies
impl StructuralPartialEq for FunctionalDependencies
Auto Trait Implementations§
impl RefUnwindSafe for FunctionalDependencies
impl Send for FunctionalDependencies
impl Sync for FunctionalDependencies
impl Unpin for FunctionalDependencies
impl UnwindSafe for FunctionalDependencies
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.