pub struct LevelPath { /* private fields */ }Expand description
Path from the top level to one graph level: the chain of enclosing region body hops. Empty = the top level.
Implementations§
Source§impl LevelPath
impl LevelPath
Sourcepub fn top_level_ancestor(&self, local: BloqNodeId) -> BloqNodeId
pub fn top_level_ancestor(&self, local: BloqNodeId) -> BloqNodeId
The top-level ancestor of a node at this level: the outermost
enclosing region for a nested level, else local itself.
Because ids are level-local, a node’s own local id
is only a valid key for Bloq::top/SubGraph::node when the node
is at the top level. For a node inside a region body, this returns the
id of the outermost enclosing region — the one node on the walk from the
top level down to it that a top-level lookup can resolve. Passing a
body-local local id straight to a top-level lookup would silently hit
the wrong node (or none); route it through here first.
Sourcepub fn segments(&self) -> &[LevelSegment]
pub fn segments(&self) -> &[LevelSegment]
The region-body hops from the top level down, outermost first.
Sourcepub fn is_top_level(&self) -> bool
pub fn is_top_level(&self) -> bool
Whether this path identifies the top level.
Sourcepub fn starts_with(&self, prefix: &Self) -> bool
pub fn starts_with(&self, prefix: &Self) -> bool
Whether this path is prefix or lies inside it.
Sourcepub fn child(&self, region: BloqNodeId, body: BodySelector) -> Self
pub fn child(&self, region: BloqNodeId, body: BodySelector) -> Self
This path extended by descending into region’s body.
Trait Implementations§
impl Eq for LevelPath
Source§impl Ord for LevelPath
impl Ord for LevelPath
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for LevelPath
impl PartialOrd for LevelPath
impl StructuralPartialEq for LevelPath
Auto Trait Implementations§
impl Freeze for LevelPath
impl RefUnwindSafe for LevelPath
impl Send for LevelPath
impl Sync for LevelPath
impl Unpin for LevelPath
impl UnsafeUnpin for LevelPath
impl UnwindSafe for LevelPath
Blanket Implementations§
§impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseMutViaBorrow<BorrowedSelf> for T
fn assign_index(&mut self, index: usize, to: bool)
fn negate_index(&mut self, index: usize)
fn clear_bits(&mut self)
fn assign_random(
&mut self,
bit_count: usize,
random_number_generator: &mut impl RngExt,
)where
BorrowedSelf: BitLength,
§impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
impl<Bits, Other, BorrowedSelf, BorrowedOther> BitwisePairMutViaBorrow<Other, BorrowedSelf, BorrowedOther> for Bits
fn assign(&mut self, other: &Other)
fn bitxor_assign(&mut self, other: &Other)
fn bitand_assign(&mut self, other: &Other)
fn bitor_assign(&mut self, other: &Other)
§impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
impl<T, Other, BorrowedSelf, BorrowedOther> BitwisePairViaBorrow<Other, BorrowedSelf, BorrowedOther> for T
§impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
impl<T, BorrowedSelf> BitwiseViaBorrow<BorrowedSelf> for T
fn index(&self, index: usize) -> bool
fn weight(&self) -> usize
fn parity(&self) -> bool
fn is_zero(&self) -> bool
fn is_unit(&self, index: usize) -> bool
fn support<'a>(&'a self) -> impl SortedIteratorwhere
BorrowedSelf: 'a,
fn max_support(&self) -> Option<usize>
fn min_support(&self) -> Option<usize>
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.