pub struct JoinRelation { /* private fields */ }Expand description
One relation participating in a join, with its per-attribute degrees.
Implementations§
Source§impl JoinRelation
impl JoinRelation
Sourcepub fn new(rows: u64) -> Self
pub fn new(rows: u64) -> Self
A relation of rows rows with no degree information. Every
attribute defaults to AttributeDegree::unknown.
§Examples
use samkhya_core::degree::JoinRelation;
assert_eq!(JoinRelation::new(42).rows(), 42);Sourcepub fn with_degree(
self,
attribute: AttributeId,
degree: AttributeDegree,
) -> Self
pub fn with_degree( self, attribute: AttributeId, degree: AttributeDegree, ) -> Self
Attach a degree bound for one join attribute.
§Examples
use samkhya_core::degree::{AttributeDegree, JoinRelation};
let r = JoinRelation::new(100)
.with_degree(7, AttributeDegree::from_distinct(100, 100));
assert_eq!(r.degree(7).max_degree(), 1);Sourcepub fn degree(&self, attribute: AttributeId) -> AttributeDegree
pub fn degree(&self, attribute: AttributeId) -> AttributeDegree
Degree bound for attribute, defaulting to the always-sound
AttributeDegree::unknown when none was supplied.
§Examples
use samkhya_core::degree::JoinRelation;
// No degree registered → falls back to the row count.
assert_eq!(JoinRelation::new(64).degree(3).max_degree(), 64);Trait Implementations§
Source§impl Clone for JoinRelation
impl Clone for JoinRelation
Source§fn clone(&self) -> JoinRelation
fn clone(&self) -> JoinRelation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for JoinRelation
impl RefUnwindSafe for JoinRelation
impl Send for JoinRelation
impl Sync for JoinRelation
impl Unpin for JoinRelation
impl UnsafeUnpin for JoinRelation
impl UnwindSafe for JoinRelation
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