Struct bytecode::access_path_trie::TrieNode
source · pub struct TrieNode<T: FootprintDomain> { /* private fields */ }
Expand description
A node in the access Trie: data
associated with the parent node + children
mapping offsets to child nodes
Implementations§
source§impl<T: FootprintDomain> TrieNode<T>
impl<T: FootprintDomain> TrieNode<T>
pub fn new(data: T) -> Self
pub fn new_opt(data: Option<T>) -> Self
sourcepub fn join_data_opt_(data: &mut Option<T>, other: &Option<T>) -> JoinResult
pub fn join_data_opt_(data: &mut Option<T>, other: &Option<T>) -> JoinResult
Like join, but gracefully handles Non
data fields by treating None as Bottom
sourcepub fn join_data_opt(&mut self, other: &Option<T>) -> JoinResult
pub fn join_data_opt(&mut self, other: &Option<T>) -> JoinResult
Like join, but gracefully handles None
data fields by treating None as Bottom
pub fn join_child_data(&self, acc: Option<T>) -> Option<T>
pub fn get_child_data(&self) -> Option<T>
pub fn data(&self) -> &Option<T>
pub fn children(&self) -> &MapDomain<Offset, TrieNode<T>>
pub fn entry(&mut self, o: Offset) -> Entry<'_, Offset, TrieNode<T>>
sourcepub fn get_offset(&self, o: &Offset) -> Option<&Self>
pub fn get_offset(&self, o: &Offset) -> Option<&Self>
Return the node mapped to o
from self (if any)
sourcepub fn get_offset_mut(&mut self, o: &Offset) -> Option<&mut Self>
pub fn get_offset_mut(&mut self, o: &Offset) -> Option<&mut Self>
Return a mutable reference to the node mapped to o
from self (if any)
sourcepub fn remove_offset(&mut self, o: &Offset) -> Option<Self>
pub fn remove_offset(&mut self, o: &Offset) -> Option<Self>
Removes the node mapped to o
from self (if it exists)
sourcepub fn keys_statically_known(&self) -> bool
pub fn keys_statically_known(&self) -> bool
Return true if self
’s keys can be converted into a compact set of concrete access paths
Note: this says nothing about the data
part of self
sourcepub fn substitute_footprint<F>(
self,
actuals: &[TempIndex],
type_actuals: &[Type],
func_env: &FunctionEnv<'_>,
sub_map: &dyn AccessPathMap<AbsAddr>,
sub_data: F
) -> Selfwhere
F: FnMut(&mut T, &[TempIndex], &[Type], &FunctionEnv<'_>, &dyn AccessPathMap<AbsAddr>) + Copy,
pub fn substitute_footprint<F>( self, actuals: &[TempIndex], type_actuals: &[Type], func_env: &FunctionEnv<'_>, sub_map: &dyn AccessPathMap<AbsAddr>, sub_data: F ) -> Selfwhere F: FnMut(&mut T, &[TempIndex], &[Type], &FunctionEnv<'_>, &dyn AccessPathMap<AbsAddr>) + Copy,
Bind caller data in actuals
, type_actuals
, and sub_map
to self
.
(1) Bind all free type variables in self
to type_actuals
(2) Apply sub_data
to self.data
and (recursively) to the data
fields of self.children
sourcepub fn iter_values<F>(&mut self, f: F)where
F: FnMut(&mut TrieNode<T>) + Copy,
pub fn iter_values<F>(&mut self, f: F)where F: FnMut(&mut TrieNode<T>) + Copy,
Apply f
to each node in self
sourcepub fn iter_offsets<F>(&self, f: F) -> Fwhere
F: FnMut(&Offset),
pub fn iter_offsets<F>(&self, f: F) -> Fwhere F: FnMut(&Offset),
Apply f
to each offset in self
Trait Implementations§
source§impl<T: FootprintDomain> AbstractDomain for TrieNode<T>
impl<T: FootprintDomain> AbstractDomain for TrieNode<T>
fn join(&mut self, other: &Self) -> JoinResult
source§impl<T: FootprintDomain> Default for TrieNode<T>
impl<T: FootprintDomain> Default for TrieNode<T>
source§impl<T: PartialEq + FootprintDomain> PartialEq<TrieNode<T>> for TrieNode<T>
impl<T: PartialEq + FootprintDomain> PartialEq<TrieNode<T>> for TrieNode<T>
source§impl<T: PartialOrd + FootprintDomain> PartialOrd<TrieNode<T>> for TrieNode<T>
impl<T: PartialOrd + FootprintDomain> PartialOrd<TrieNode<T>> for TrieNode<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl<T: Eq + FootprintDomain> Eq for TrieNode<T>
impl<T: FootprintDomain> StructuralEq for TrieNode<T>
impl<T: FootprintDomain> StructuralPartialEq for TrieNode<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for TrieNode<T>where T: RefUnwindSafe,
impl<T> Send for TrieNode<T>where T: Send + Sync,
impl<T> Sync for TrieNode<T>where T: Send + Sync,
impl<T> Unpin for TrieNode<T>where T: Unpin,
impl<T> UnwindSafe for TrieNode<T>where T: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.