pub struct Set(pub VecSet<Value>);Expand description
Internal Set type that stores unique values
Sets use VecSet internally to maintain uniqueness and sorted order.
- Rev 1 —
u16 revision || VecSet<Value>(length-prefixed). Byte-identical to the legacy on-disk encoding. - Rev 2 — optimised envelope (
u16 revision || u32_le payload_length), innerVecSetwritten via the indexed-set prologue pastOFFSET_TABLE_MIN_LEN = 8. Walker descent stays zero-allocation through the Wire-repr fast path (skip + borrow).
Tuple Fields§
§0: VecSet<Value>Implementations§
Source§impl Set
impl Set
Sourcepub fn walk_revisioned_field_names(
wire_revision: u16,
) -> &'static [&'static str]
pub fn walk_revisioned_field_names( wire_revision: u16, ) -> &'static [&'static str]
Field names at the given wire revision in declaration order.
Returns an empty slice if the revision is unknown. Generated
by the revisioned derive.
Source§impl Set
impl Set
Sourcepub fn first_mut(&mut self) -> Option<&mut Value>
pub fn first_mut(&mut self) -> Option<&mut Value>
Get a mutable reference to the first value in the set
Sourcepub fn last_mut(&mut self) -> Option<&mut Value>
pub fn last_mut(&mut self) -> Option<&mut Value>
Get a mutable reference to the last value in the set
Sourcepub fn nth_mut(&mut self, index: usize) -> Option<&mut Value>
pub fn nth_mut(&mut self, index: usize) -> Option<&mut Value>
Get a mutable reference to the nth value in the set
Sourcepub fn insert(&mut self, value: Value) -> bool
pub fn insert(&mut self, value: Value) -> bool
Insert a value into the set Returns true if the value was newly inserted
Sourcepub fn remove(&mut self, value: &Value) -> bool
pub fn remove(&mut self, value: &Value) -> bool
Remove a value from the set Returns true if the value was present
Sourcepub fn into_literal(self) -> Vec<Expr>
pub fn into_literal(self) -> Vec<Expr>
Convert into a literal expression
Sourcepub fn intersection(&self, other: &Set) -> Set
pub fn intersection(&self, other: &Set) -> Set
Return the intersection of this set with another (A ∩ B)
Sourcepub fn symmetric_difference(&self, other: &Set) -> Set
pub fn symmetric_difference(&self, other: &Set) -> Set
Return the symmetric difference (A △ B) - elements in either but not both
Sourcepub fn complement(&self, other: &Set) -> Set
pub fn complement(&self, other: &Set) -> Set
Return the relative complement (A \ B) - elements in self but not in other
Trait Implementations§
Source§impl<'de> BorrowDecode<'de, IndexFormat> for Set
impl<'de> BorrowDecode<'de, IndexFormat> for Set
fn borrow_decode(_r: &mut BorrowReader<'de>) -> Result<Self, DecodeError>
Source§impl<'de> BorrowDecode<'de> for Set
impl<'de> BorrowDecode<'de> for Set
fn borrow_decode(_r: &mut BorrowReader<'de>) -> Result<Self, DecodeError>
Source§impl DeserializeRevisioned for Set
impl DeserializeRevisioned for Set
Source§impl Encode<IndexFormat> for Set
impl Encode<IndexFormat> for Set
impl Eq for Set
Source§impl FromIterator<Value> for Set
impl FromIterator<Value> for Set
Source§impl IntoIterator for Set
impl IntoIterator for Set
Source§impl Ord for Set
impl Ord for Set
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Set
impl PartialOrd for Set
Source§impl Revisioned for Set
impl Revisioned for Set
Source§impl SerializeRevisioned for Set
impl SerializeRevisioned for Set
Source§impl SkipCheckRevisioned for Set
impl SkipCheckRevisioned for Set
Source§impl SkipRevisioned for Set
impl SkipRevisioned for Set
fn skip_revisioned<R: Read>(reader: &mut R) -> Result<(), Error>
Source§fn skip_revisioned_slice(reader: &mut SliceReader<'_>) -> Result<(), Error>
fn skip_revisioned_slice(reader: &mut SliceReader<'_>) -> Result<(), Error>
SliceReader without allocating a buffer for bulk segments. Read moreimpl StructuralPartialEq for Set
Source§impl WalkRevisioned for Set
impl WalkRevisioned for Set
Source§type Walker<'r, R: BorrowedReader + 'r> = SetWalker<'r, R>
type Walker<'r, R: BorrowedReader + 'r> = SetWalker<'r, R>
walk_revisioned. Read moreSource§fn walk_revisioned<'r, R: BorrowedReader>(
reader: &'r mut R,
) -> Result<Self::Walker<'r, R>, Error>
fn walk_revisioned<'r, R: BorrowedReader>( reader: &'r mut R, ) -> Result<Self::Walker<'r, R>, Error>
Auto Trait Implementations§
impl !RefUnwindSafe for Set
impl !UnwindSafe for Set
impl Freeze for Set
impl Send for Set
impl Sync for Set
impl Unpin for Set
impl UnsafeUnpin for Set
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.