pub struct AliasRegionSet { /* private fields */ }Expand description
A deduplicated set of alias regions.
Deduplication is based on user_id; the description string is not
considered.
Implementations§
Source§impl AliasRegionSet
impl AliasRegionSet
Sourcepub fn insert(&mut self, data: AliasRegionData) -> AliasRegion
pub fn insert(&mut self, data: AliasRegionData) -> AliasRegion
Insert a new alias region into this set.
Returns an existing AliasRegion if one with the same user_id
already exists.
Sourcepub fn push(&mut self, data: AliasRegionData) -> AliasRegion
pub fn push(&mut self, data: AliasRegionData) -> AliasRegion
Push a new alias region, bypassing deduplication.
This is used by the CLIF text parser to faithfully represent the
source text. The verifier will then check for duplicate user_ids.
Sourcepub fn contains(&self, user_id: u32) -> bool
pub fn contains(&self, user_id: u32) -> bool
Returns true if this set already contains a region with the given
user_id.
Sourcepub fn is_valid(&self, ar: AliasRegion) -> bool
pub fn is_valid(&self, ar: AliasRegion) -> bool
Returns true if the given alias region reference is valid.
Sourcepub fn iter(&self) -> impl Iterator<Item = (AliasRegion, &AliasRegionData)>
pub fn iter(&self) -> impl Iterator<Item = (AliasRegion, &AliasRegionData)>
Iterate over all alias regions and their data.
Trait Implementations§
Source§impl Clone for AliasRegionSet
impl Clone for AliasRegionSet
Source§fn clone(&self) -> AliasRegionSet
fn clone(&self) -> AliasRegionSet
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 moreSource§impl<'de> Deserialize<'de> for AliasRegionSet
impl<'de> Deserialize<'de> for AliasRegionSet
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for AliasRegionSet
impl Hash for AliasRegionSet
Source§impl Index<AliasRegion> for AliasRegionSet
impl Index<AliasRegion> for AliasRegionSet
Source§type Output = AliasRegionData
type Output = AliasRegionData
The returned type after indexing.
Source§fn index(&self, ar: AliasRegion) -> &AliasRegionData
fn index(&self, ar: AliasRegion) -> &AliasRegionData
Performs the indexing (
container[index]) operation. Read moreSource§impl PartialEq for AliasRegionSet
impl PartialEq for AliasRegionSet
Source§fn eq(&self, other: &AliasRegionSet) -> bool
fn eq(&self, other: &AliasRegionSet) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AliasRegionSet
impl Serialize for AliasRegionSet
impl StructuralPartialEq for AliasRegionSet
Auto Trait Implementations§
impl Freeze for AliasRegionSet
impl RefUnwindSafe for AliasRegionSet
impl Send for AliasRegionSet
impl Sync for AliasRegionSet
impl Unpin for AliasRegionSet
impl UnsafeUnpin for AliasRegionSet
impl UnwindSafe for AliasRegionSet
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