Skip to main content

ProvenanceRelation

Struct ProvenanceRelation 

Source
pub struct ProvenanceRelation<F: Ord, P: Ord> { /* private fields */ }
Expand description

Deterministic exact provenance attached to stored facts.

ProvenanceRelation<F, P> maps each stored fact to a deterministic set of provenance tokens. Repeated insertion of the same (fact, token) pair is idempotent. Inserting a new token for an existing fact combines provenance by exact set union.

In this first additive provenance slice, every stored fact is a base fact. The module does not yet derive new tuples. Self::why explains stored facts only; derived-tuple explanations and why_not queries remain later work.

§Examples

use relmath::{UnaryRelation, provenance::ProvenanceRelation};

let gene_disease = ProvenanceRelation::from_facts([
    (("BRCA1", "BreastCancer"), "paper_12"),
    (("BRCA1", "BreastCancer"), "curated_panel"),
    (("TP53", "BreastCancer"), "paper_77"),
]);

let supported = gene_disease.to_binary_relation();
let brca1 = UnaryRelation::singleton("BRCA1");

assert_eq!(supported.image(&brca1).to_vec(), vec!["BreastCancer"]);
assert_eq!(
    gene_disease
        .why(&("BRCA1", "BreastCancer"))
        .expect("expected explanation")
        .to_vec(),
    vec!["curated_panel", "paper_12"]
);

Implementations§

Source§

impl<F: Ord, P: Ord> ProvenanceRelation<F, P>

Source

pub fn new() -> Self

Creates an empty provenance relation.

§Examples
use relmath::provenance::ProvenanceRelation;

let mut evidence = ProvenanceRelation::new();

assert!(evidence.insert(("BRCA1", "BreastCancer"), "paper_12"));
assert!(!evidence.insert(("BRCA1", "BreastCancer"), "paper_12"));
assert!(evidence.contains_fact(&("BRCA1", "BreastCancer")));
assert_eq!(
    evidence
        .provenance_of(&("BRCA1", "BreastCancer"))
        .expect("expected explanation")
        .to_vec(),
    vec!["paper_12"]
);
Source

pub fn from_facts<I>(facts: I) -> Self
where I: IntoIterator<Item = (F, P)>,

Creates a provenance relation from (fact, token) entries.

Repeated facts accumulate tokens by exact set union.

Examples found in repository?
examples/provenance.rs (lines 6-10)
5fn main() {
6    let gene_disease = ProvenanceRelation::from_facts([
7        (("BRCA1", "BreastCancer"), "curated_panel"),
8        (("BRCA1", "BreastCancer"), "paper_12"),
9        (("TP53", "BreastCancer"), "paper_77"),
10    ]);
11
12    let disease_drug = relmath::BinaryRelation::from_pairs([
13        ("BreastCancer", "Olaparib"),
14        ("BreastCancer", "Tamoxifen"),
15    ]);
16
17    let supported_gene_disease = gene_disease.to_binary_relation();
18    let gene_drug = supported_gene_disease.compose(&disease_drug);
19    let brca1 = UnaryRelation::singleton("BRCA1");
20    let brca1_witness = gene_disease
21        .why(&("BRCA1", "BreastCancer"))
22        .expect("expected explanation");
23
24    assert_eq!(
25        gene_drug.image(&brca1).to_vec(),
26        vec!["Olaparib", "Tamoxifen"]
27    );
28    assert_eq!(brca1_witness.to_vec(), vec!["curated_panel", "paper_12"]);
29    assert!(brca1_witness.contains_token(&"paper_12"));
30    assert_eq!(
31        gene_disease
32            .provenance_of(&("BRCA1", "BreastCancer"))
33            .expect("expected explanation")
34            .to_vec(),
35        brca1_witness.to_vec()
36    );
37    assert_eq!(
38        gene_disease.support().to_vec(),
39        vec![("BRCA1", "BreastCancer"), ("TP53", "BreastCancer")]
40    );
41    assert!(gene_disease.why(&("BRCA1", "Olaparib")).is_none());
42
43    println!(
44        "why BRCA1 links to BreastCancer in the base evidence: {:?}",
45        brca1_witness.to_vec()
46    );
47}
More examples
Hide additional examples
examples/capability_boundaries.rs (lines 23-26)
22fn main() {
23    let evidence = ProvenanceRelation::from_facts([
24        (("alice", "review"), "directory"),
25        (("bob", "approve"), "policy"),
26    ]);
27    let permissions = AnnotatedRelation::from_facts([
28        (("alice", "review"), BooleanSemiring::TRUE),
29        (("bob", "approve"), BooleanSemiring::TRUE),
30    ]);
31    let schedule = ValidTimeRelation::from_facts([
32        (
33            ("alice", "review"),
34            Interval::new(1, 3).expect("expected valid interval"),
35        ),
36        (
37            ("bob", "approve"),
38            Interval::new(2, 4).expect("expected valid interval"),
39        ),
40    ]);
41
42    let exact_evidence = exact_pairs(&evidence);
43    let exact_permissions = exact_pairs(&permissions);
44    let exact_schedule = exact_pairs(&schedule);
45
46    assert_eq!(
47        exact_evidence.to_vec(),
48        vec![("alice", "review"), ("bob", "approve")]
49    );
50    assert_eq!(exact_permissions.to_vec(), exact_evidence.to_vec());
51    assert_eq!(exact_schedule.to_vec(), exact_evidence.to_vec());
52
53    assert_eq!(
54        evidence
55            .why(&("alice", "review"))
56            .expect("expected witness")
57            .to_vec(),
58        vec!["directory"]
59    );
60    assert_eq!(
61        permissions.annotation_of(&("alice", "review")),
62        Some(&BooleanSemiring::TRUE)
63    );
64    assert_eq!(
65        schedule
66            .valid_time_of(&("alice", "review"))
67            .expect("expected interval support")
68            .to_vec(),
69        vec![Interval::new(1, 3).expect("expected valid interval")]
70    );
71
72    println!(
73        "witness={:?}, annotation={:?}, interval_support={:?}, exact_support={:?}",
74        evidence
75            .why(&("alice", "review"))
76            .expect("expected witness")
77            .to_vec(),
78        permissions.annotation_of(&("alice", "review")),
79        schedule
80            .valid_time_of(&("alice", "review"))
81            .expect("expected interval support")
82            .to_vec(),
83        exact_schedule.to_vec()
84    );
85}
Source

pub fn insert(&mut self, fact: F, token: P) -> bool

Inserts one provenance token for a fact.

Returns true when the token was not already attached to the fact.

Source

pub fn contains_fact(&self, fact: &F) -> bool

Returns true when the relation contains the given fact.

Source

pub fn why(&self, fact: &F) -> Option<&ProvenanceSet<P>>

Returns why fact is present in this provenance relation.

When fact is present, the returned witness is the deterministic exact set of provenance tokens attached to that stored fact. When fact is absent, this returns None.

In this first G3 slice, every stored fact is a base fact with at least one token, so None means the relation has no explanation for the fact because the fact is absent.

§Examples
use relmath::provenance::ProvenanceRelation;

let evidence = ProvenanceRelation::from_facts([
    (("BRCA1", "BreastCancer"), "paper_12"),
    (("BRCA1", "BreastCancer"), "curated_panel"),
]);

let why = evidence
    .why(&("BRCA1", "BreastCancer"))
    .expect("expected explanation");

assert!(why.contains_token(&"paper_12"));
assert!(why.contains_token(&"curated_panel"));
assert!(evidence.why(&("BRCA1", "Olaparib")).is_none());
Examples found in repository?
examples/provenance.rs (line 21)
5fn main() {
6    let gene_disease = ProvenanceRelation::from_facts([
7        (("BRCA1", "BreastCancer"), "curated_panel"),
8        (("BRCA1", "BreastCancer"), "paper_12"),
9        (("TP53", "BreastCancer"), "paper_77"),
10    ]);
11
12    let disease_drug = relmath::BinaryRelation::from_pairs([
13        ("BreastCancer", "Olaparib"),
14        ("BreastCancer", "Tamoxifen"),
15    ]);
16
17    let supported_gene_disease = gene_disease.to_binary_relation();
18    let gene_drug = supported_gene_disease.compose(&disease_drug);
19    let brca1 = UnaryRelation::singleton("BRCA1");
20    let brca1_witness = gene_disease
21        .why(&("BRCA1", "BreastCancer"))
22        .expect("expected explanation");
23
24    assert_eq!(
25        gene_drug.image(&brca1).to_vec(),
26        vec!["Olaparib", "Tamoxifen"]
27    );
28    assert_eq!(brca1_witness.to_vec(), vec!["curated_panel", "paper_12"]);
29    assert!(brca1_witness.contains_token(&"paper_12"));
30    assert_eq!(
31        gene_disease
32            .provenance_of(&("BRCA1", "BreastCancer"))
33            .expect("expected explanation")
34            .to_vec(),
35        brca1_witness.to_vec()
36    );
37    assert_eq!(
38        gene_disease.support().to_vec(),
39        vec![("BRCA1", "BreastCancer"), ("TP53", "BreastCancer")]
40    );
41    assert!(gene_disease.why(&("BRCA1", "Olaparib")).is_none());
42
43    println!(
44        "why BRCA1 links to BreastCancer in the base evidence: {:?}",
45        brca1_witness.to_vec()
46    );
47}
More examples
Hide additional examples
examples/capability_boundaries.rs (line 55)
22fn main() {
23    let evidence = ProvenanceRelation::from_facts([
24        (("alice", "review"), "directory"),
25        (("bob", "approve"), "policy"),
26    ]);
27    let permissions = AnnotatedRelation::from_facts([
28        (("alice", "review"), BooleanSemiring::TRUE),
29        (("bob", "approve"), BooleanSemiring::TRUE),
30    ]);
31    let schedule = ValidTimeRelation::from_facts([
32        (
33            ("alice", "review"),
34            Interval::new(1, 3).expect("expected valid interval"),
35        ),
36        (
37            ("bob", "approve"),
38            Interval::new(2, 4).expect("expected valid interval"),
39        ),
40    ]);
41
42    let exact_evidence = exact_pairs(&evidence);
43    let exact_permissions = exact_pairs(&permissions);
44    let exact_schedule = exact_pairs(&schedule);
45
46    assert_eq!(
47        exact_evidence.to_vec(),
48        vec![("alice", "review"), ("bob", "approve")]
49    );
50    assert_eq!(exact_permissions.to_vec(), exact_evidence.to_vec());
51    assert_eq!(exact_schedule.to_vec(), exact_evidence.to_vec());
52
53    assert_eq!(
54        evidence
55            .why(&("alice", "review"))
56            .expect("expected witness")
57            .to_vec(),
58        vec!["directory"]
59    );
60    assert_eq!(
61        permissions.annotation_of(&("alice", "review")),
62        Some(&BooleanSemiring::TRUE)
63    );
64    assert_eq!(
65        schedule
66            .valid_time_of(&("alice", "review"))
67            .expect("expected interval support")
68            .to_vec(),
69        vec![Interval::new(1, 3).expect("expected valid interval")]
70    );
71
72    println!(
73        "witness={:?}, annotation={:?}, interval_support={:?}, exact_support={:?}",
74        evidence
75            .why(&("alice", "review"))
76            .expect("expected witness")
77            .to_vec(),
78        permissions.annotation_of(&("alice", "review")),
79        schedule
80            .valid_time_of(&("alice", "review"))
81            .expect("expected interval support")
82            .to_vec(),
83        exact_schedule.to_vec()
84    );
85}
Source

pub fn provenance_of(&self, fact: &F) -> Option<&ProvenanceSet<P>>

Returns the deterministic provenance set for one fact.

Prefer Self::why for explanation-oriented queries.

Examples found in repository?
examples/provenance.rs (line 32)
5fn main() {
6    let gene_disease = ProvenanceRelation::from_facts([
7        (("BRCA1", "BreastCancer"), "curated_panel"),
8        (("BRCA1", "BreastCancer"), "paper_12"),
9        (("TP53", "BreastCancer"), "paper_77"),
10    ]);
11
12    let disease_drug = relmath::BinaryRelation::from_pairs([
13        ("BreastCancer", "Olaparib"),
14        ("BreastCancer", "Tamoxifen"),
15    ]);
16
17    let supported_gene_disease = gene_disease.to_binary_relation();
18    let gene_drug = supported_gene_disease.compose(&disease_drug);
19    let brca1 = UnaryRelation::singleton("BRCA1");
20    let brca1_witness = gene_disease
21        .why(&("BRCA1", "BreastCancer"))
22        .expect("expected explanation");
23
24    assert_eq!(
25        gene_drug.image(&brca1).to_vec(),
26        vec!["Olaparib", "Tamoxifen"]
27    );
28    assert_eq!(brca1_witness.to_vec(), vec!["curated_panel", "paper_12"]);
29    assert!(brca1_witness.contains_token(&"paper_12"));
30    assert_eq!(
31        gene_disease
32            .provenance_of(&("BRCA1", "BreastCancer"))
33            .expect("expected explanation")
34            .to_vec(),
35        brca1_witness.to_vec()
36    );
37    assert_eq!(
38        gene_disease.support().to_vec(),
39        vec![("BRCA1", "BreastCancer"), ("TP53", "BreastCancer")]
40    );
41    assert!(gene_disease.why(&("BRCA1", "Olaparib")).is_none());
42
43    println!(
44        "why BRCA1 links to BreastCancer in the base evidence: {:?}",
45        brca1_witness.to_vec()
46    );
47}
Source

pub fn iter(&self) -> impl Iterator<Item = (&F, &ProvenanceSet<P>)>

Returns an iterator over facts and provenance in deterministic order.

§Examples
use relmath::provenance::ProvenanceRelation;

let evidence = ProvenanceRelation::from_facts([
    (("BRCA1", "BreastCancer"), "paper_12"),
    (("BRCA1", "BreastCancer"), "curated_panel"),
    (("TP53", "BreastCancer"), "paper_77"),
]);

assert_eq!(
    evidence
        .iter()
        .map(|(fact, witness)| (*fact, witness.to_vec()))
        .collect::<Vec<_>>(),
    vec![
        (("BRCA1", "BreastCancer"), vec!["curated_panel", "paper_12"]),
        (("TP53", "BreastCancer"), vec!["paper_77"]),
    ]
);
Source

pub fn support(&self) -> UnaryRelation<F>
where F: Clone,

Returns the exact support relation of stored facts as a unary relation.

This support forgets provenance and keeps only which facts are present. Generic code can access the same relation-level boundary through crate::ExactSupport::exact_support.

§Examples
use relmath::provenance::ProvenanceRelation;

let evidence = ProvenanceRelation::from_facts([
    (("BRCA1", "BreastCancer"), "paper_12"),
    (("BRCA1", "BreastCancer"), "curated_panel"),
    (("TP53", "BreastCancer"), "paper_77"),
]);

assert_eq!(
    evidence.support().to_vec(),
    vec![("BRCA1", "BreastCancer"), ("TP53", "BreastCancer")]
);
Examples found in repository?
examples/provenance.rs (line 38)
5fn main() {
6    let gene_disease = ProvenanceRelation::from_facts([
7        (("BRCA1", "BreastCancer"), "curated_panel"),
8        (("BRCA1", "BreastCancer"), "paper_12"),
9        (("TP53", "BreastCancer"), "paper_77"),
10    ]);
11
12    let disease_drug = relmath::BinaryRelation::from_pairs([
13        ("BreastCancer", "Olaparib"),
14        ("BreastCancer", "Tamoxifen"),
15    ]);
16
17    let supported_gene_disease = gene_disease.to_binary_relation();
18    let gene_drug = supported_gene_disease.compose(&disease_drug);
19    let brca1 = UnaryRelation::singleton("BRCA1");
20    let brca1_witness = gene_disease
21        .why(&("BRCA1", "BreastCancer"))
22        .expect("expected explanation");
23
24    assert_eq!(
25        gene_drug.image(&brca1).to_vec(),
26        vec!["Olaparib", "Tamoxifen"]
27    );
28    assert_eq!(brca1_witness.to_vec(), vec!["curated_panel", "paper_12"]);
29    assert!(brca1_witness.contains_token(&"paper_12"));
30    assert_eq!(
31        gene_disease
32            .provenance_of(&("BRCA1", "BreastCancer"))
33            .expect("expected explanation")
34            .to_vec(),
35        brca1_witness.to_vec()
36    );
37    assert_eq!(
38        gene_disease.support().to_vec(),
39        vec![("BRCA1", "BreastCancer"), ("TP53", "BreastCancer")]
40    );
41    assert!(gene_disease.why(&("BRCA1", "Olaparib")).is_none());
42
43    println!(
44        "why BRCA1 links to BreastCancer in the base evidence: {:?}",
45        brca1_witness.to_vec()
46    );
47}
Source§

impl<T: Ord + Clone, P: Ord> ProvenanceRelation<T, P>

Source

pub fn to_unary_relation(&self) -> UnaryRelation<T>

Converts scalar facts into a unary relation support set.

Generic code can access the same unary materialization boundary through crate::ToExactUnaryRelation.

§Examples
use relmath::provenance::ProvenanceRelation;

let concepts = ProvenanceRelation::from_facts([
    ("Relations", "lecture_1"),
    ("Relations", "worksheet"),
    ("Closure", "lecture_2"),
]);

assert_eq!(concepts.to_unary_relation().to_vec(), vec!["Closure", "Relations"]);
Source§

impl<A: Ord + Clone, B: Ord + Clone, P: Ord> ProvenanceRelation<(A, B), P>

Source

pub fn to_binary_relation(&self) -> BinaryRelation<A, B>

Converts pair facts into a binary relation support set.

Generic code can access the same binary materialization boundary through crate::ToExactBinaryRelation.

§Examples
use relmath::provenance::ProvenanceRelation;

let evidence = ProvenanceRelation::from_facts([
    (("Alice", "Reader"), "directory"),
    (("Bob", "Editor"), "directory"),
]);

assert_eq!(
    evidence.to_binary_relation().to_vec(),
    vec![("Alice", "Reader"), ("Bob", "Editor")]
);
Examples found in repository?
examples/provenance.rs (line 17)
5fn main() {
6    let gene_disease = ProvenanceRelation::from_facts([
7        (("BRCA1", "BreastCancer"), "curated_panel"),
8        (("BRCA1", "BreastCancer"), "paper_12"),
9        (("TP53", "BreastCancer"), "paper_77"),
10    ]);
11
12    let disease_drug = relmath::BinaryRelation::from_pairs([
13        ("BreastCancer", "Olaparib"),
14        ("BreastCancer", "Tamoxifen"),
15    ]);
16
17    let supported_gene_disease = gene_disease.to_binary_relation();
18    let gene_drug = supported_gene_disease.compose(&disease_drug);
19    let brca1 = UnaryRelation::singleton("BRCA1");
20    let brca1_witness = gene_disease
21        .why(&("BRCA1", "BreastCancer"))
22        .expect("expected explanation");
23
24    assert_eq!(
25        gene_drug.image(&brca1).to_vec(),
26        vec!["Olaparib", "Tamoxifen"]
27    );
28    assert_eq!(brca1_witness.to_vec(), vec!["curated_panel", "paper_12"]);
29    assert!(brca1_witness.contains_token(&"paper_12"));
30    assert_eq!(
31        gene_disease
32            .provenance_of(&("BRCA1", "BreastCancer"))
33            .expect("expected explanation")
34            .to_vec(),
35        brca1_witness.to_vec()
36    );
37    assert_eq!(
38        gene_disease.support().to_vec(),
39        vec![("BRCA1", "BreastCancer"), ("TP53", "BreastCancer")]
40    );
41    assert!(gene_disease.why(&("BRCA1", "Olaparib")).is_none());
42
43    println!(
44        "why BRCA1 links to BreastCancer in the base evidence: {:?}",
45        brca1_witness.to_vec()
46    );
47}
Source§

impl<T: Ord + Clone, P: Ord> ProvenanceRelation<Vec<T>, P>

Source

pub fn to_nary_relation<I, S>( &self, schema: I, ) -> Result<NaryRelation<T>, NaryRelationError>
where I: IntoIterator<Item = S>, S: Into<String>,

Converts row facts into an n-ary relation with the given schema.

The explicit schema preserves the current exact n-ary boundary where row values do not themselves encode column names. This method reuses the current NaryRelation validation rules, so duplicate or blank column names and row-arity mismatches return NaryRelationError. Generic code can access the same n-ary materialization boundary through crate::ToExactNaryRelation.

§Examples
use relmath::provenance::ProvenanceRelation;

let rows = ProvenanceRelation::from_facts([
    (vec!["Alice", "Math", "passed"], "gradebook"),
    (vec!["Alice", "Math", "passed"], "reviewed"),
    (vec!["Bob", "Physics", "passed"], "gradebook"),
]);

let relation = rows
    .to_nary_relation(["student", "course", "status"])
    .expect("expected valid support relation");

assert_eq!(
    relation.to_rows(),
    vec![
        vec!["Alice", "Math", "passed"],
        vec!["Bob", "Physics", "passed"],
    ]
);

Trait Implementations§

Source§

impl<F: Clone + Ord, P: Clone + Ord> Clone for ProvenanceRelation<F, P>

Source§

fn clone(&self) -> ProvenanceRelation<F, P>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<F: Debug + Ord, P: Debug + Ord> Debug for ProvenanceRelation<F, P>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F: Ord, P: Ord> Default for ProvenanceRelation<F, P>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<F: Ord + Clone, P: Ord> ExactSupport<F> for ProvenanceRelation<F, P>

Source§

fn exact_support(&self) -> UnaryRelation<F>

Returns the exact support of stored facts in deterministic fact order.
Source§

impl<F: Ord, P: Ord> Extend<(F, P)> for ProvenanceRelation<F, P>

Source§

fn extend<I: IntoIterator<Item = (F, P)>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<F: Ord, P: Ord> FiniteRelation for ProvenanceRelation<F, P>

Source§

fn len(&self) -> usize

Returns the number of stored tuples in the relation.
Source§

fn is_empty(&self) -> bool

Returns true when the relation contains no tuples.
Source§

impl<F: Ord, P: Ord> FromIterator<(F, P)> for ProvenanceRelation<F, P>

Source§

fn from_iter<I: IntoIterator<Item = (F, P)>>(iter: I) -> Self

Creates a value from an iterator. Read more
Source§

impl<F: PartialEq + Ord, P: PartialEq + Ord> PartialEq for ProvenanceRelation<F, P>

Source§

fn eq(&self, other: &ProvenanceRelation<F, P>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<F: Eq + Ord, P: Eq + Ord> Eq for ProvenanceRelation<F, P>

Source§

impl<F: Ord, P: Ord> StructuralPartialEq for ProvenanceRelation<F, P>

Auto Trait Implementations§

§

impl<F, P> Freeze for ProvenanceRelation<F, P>

§

impl<F, P> RefUnwindSafe for ProvenanceRelation<F, P>

§

impl<F, P> Send for ProvenanceRelation<F, P>
where F: Send, P: Send,

§

impl<F, P> Sync for ProvenanceRelation<F, P>
where F: Sync, P: Sync,

§

impl<F, P> Unpin for ProvenanceRelation<F, P>

§

impl<F, P> UnsafeUnpin for ProvenanceRelation<F, P>

§

impl<F, P> UnwindSafe for ProvenanceRelation<F, P>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<A, B, R> ToExactBinaryRelation<A, B> for R
where A: Ord + Clone, B: Ord + Clone, R: ExactSupport<(A, B)>,

Source§

fn to_binary_relation(&self) -> BinaryRelation<A, B>

Materializes exact pair support as a binary relation.
Source§

impl<T, R> ToExactNaryRelation<T> for R
where T: Ord + Clone, R: ExactSupport<Vec<T>>,

Source§

fn to_nary_relation<I, S>( &self, schema: I, ) -> Result<NaryRelation<T>, NaryRelationError>
where I: IntoIterator<Item = S>, S: Into<String>,

Materializes exact row support as an n-ary relation with the given schema.
Source§

impl<T, R> ToExactUnaryRelation<T> for R
where T: Ord + Clone, R: ExactSupport<T>,

Source§

fn to_unary_relation(&self) -> UnaryRelation<T>

Materializes exact scalar support as a unary relation.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.