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 get(&self, user_id: u32) -> Option<AliasRegion>
pub fn get(&self, user_id: u32) -> Option<AliasRegion>
Get the alias region with the given id, if any.
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§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
impl StructuralPartialEq for AliasRegionSet
Auto Trait Implementations§
impl Forget for AliasRegionSet
impl Freeze for AliasRegionSetwhere
*const u8 is !null: Freeze,
PhantomData<AliasRegionData>: Freeze,
PhantomData<AliasRegion>: Freeze,
PhantomData<(u32, AliasRegion)>: Freeze,
impl Move for AliasRegionSet
impl RefUnwindSafe for AliasRegionSetwhere
String: RefUnwindSafe,
impl Send for AliasRegionSet
impl Sync for AliasRegionSet
impl Unpin for AliasRegionSet
impl UnsafeUnpin for AliasRegionSetwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<AliasRegionData>: UnsafeUnpin,
PhantomData<AliasRegion>: UnsafeUnpin,
PhantomData<(u32, AliasRegion)>: UnsafeUnpin,
impl UnwindSafe for AliasRegionSetwhere
RawVecInner: UnwindSafe,
&'static str: UnwindSafe,
String: UnwindSafe,
HashMap<u32, AliasRegion>: UnwindSafe,
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