[−][src]Trait ena::sql::DiffTrait
Diff functions
Required methods
fn generic_diff(
&self,
endpoint: YotsubaEndpoint,
other: &T,
diff: Diff
) -> Result<Queue>
&self,
endpoint: YotsubaEndpoint,
other: &T,
diff: Diff
) -> Result<Queue>
Provided methods
fn symmetric_difference(
&self,
endpoint: YotsubaEndpoint,
other: &T
) -> Result<Queue>
[−]
&self,
endpoint: YotsubaEndpoint,
other: &T
) -> Result<Queue>
Visits the values representing the symmetric difference,
i.e., the values that are in self
or in other
but not in both.
Examples
use std::collections::HashSet; let a: HashSet<_> = [1, 2, 3].iter().cloned().collect(); let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect(); // Print 1, 4 in arbitrary order. for x in a.symmetric_difference(&b) { println!("{}", x); } let diff1: HashSet<_> = a.symmetric_difference(&b).collect(); let diff2: HashSet<_> = b.symmetric_difference(&a).collect(); assert_eq!(diff1, diff2); assert_eq!(diff1, [1, 4].iter().collect());
fn difference(&self, endpoint: YotsubaEndpoint, other: &T) -> Result<Queue>
[−]
Visits the values representing the difference,
i.e., the values that are in self
but not in other
.
Examples
use std::collections::HashSet; let a: HashSet<_> = [1, 2, 3].iter().cloned().collect(); let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect(); // Can be seen as `a - b`. for x in a.difference(&b) { println!("{}", x); // Print 1 } let diff: HashSet<_> = a.difference(&b).collect(); assert_eq!(diff, [1].iter().collect()); // Note that difference is not symmetric, // and `b - a` means something else: let diff: HashSet<_> = b.difference(&a).collect(); assert_eq!(diff, [4].iter().collect());
fn union(&self, endpoint: YotsubaEndpoint, other: &T) -> Result<Queue>
[−]
Visits the values representing the union,
i.e., all the values in self
or other
, without duplicates.
Examples
use std::collections::HashSet; let a: HashSet<_> = [1, 2, 3].iter().cloned().collect(); let b: HashSet<_> = [4, 2, 3, 4].iter().cloned().collect(); // Print 1, 2, 3, 4 in arbitrary order. for x in a.union(&b) { println!("{}", x); } let union: HashSet<_> = a.union(&b).collect(); assert_eq!(union, [1, 2, 3, 4].iter().collect());
Implementations on Foreign Types
impl DiffTrait<Vec<u8>> for Vec<u8>
[src][−]
fn generic_diff(
&self,
endpoint: YotsubaEndpoint,
other: &Vec<u8>,
diff: Diff
) -> Result<Queue>
[src]
&self,
endpoint: YotsubaEndpoint,
other: &Vec<u8>,
diff: Diff
) -> Result<Queue>
Implementors
impl DiffTrait<Vec<Threads>> for ThreadsList
[src][−]
fn generic_diff(
&self,
endpoint: YotsubaEndpoint,
other: &ThreadsList,
diff: Diff
) -> Result<Queue>
[src]
&self,
endpoint: YotsubaEndpoint,
other: &ThreadsList,
diff: Diff
) -> Result<Queue>