Skip to main content

NodeIndex

Struct NodeIndex 

Source
pub struct NodeIndex { /* private fields */ }
Expand description

An index of addressable nodes in one loaded distribution.

Implementations§

Source§

impl NodeIndex

Source

pub fn v4_file(file: &IRFile) -> Result<Self, NodeResolutionError>

Index a complete V4 file using its exact normalized format version.

Source

pub fn v4_file_with_selector( file: &IRFile, artifact: ArtifactSelector, ) -> Result<Self, NodeResolutionError>

Index a complete V4 file under a package selector or workspace alias.

Source

pub fn v4(distribution: &Distribution) -> Result<Self, NodeResolutionError>

Index a normalized V4 distribution and all currently supported semantic nodes.

Source

pub fn v4_with_selector( distribution: &Distribution, artifact: ArtifactSelector, ) -> Result<Self, NodeResolutionError>

Index a V4 distribution under its package name or an exact workspace alias.

Source

pub fn v3( distribution: &Distribution, artifact: ArtifactSelector, ) -> Result<Self, NodeResolutionError>

Index one Classic V3 library under an explicit artifact selector.

Source

pub fn v3_json(bytes: &[u8]) -> Result<Self, NodeResolutionError>

Index exact Classic V3 JSON, preserving its declared release.

Source

pub fn resolve( &self, address: &NodeUri, ) -> Result<IndexedNodeKind, NodeResolutionError>

Resolve one address in this loaded distribution. Pinned addresses require an immutable snapshot resolver and are not silently applied to current.

Source

pub fn resolve_node( &self, address: &NodeUri, ) -> Result<&ResolvedNode, NodeResolutionError>

Source

pub fn addresses(&self) -> impl Iterator<Item = &NodeUri>

Enumerate canonical current addresses in this distribution.

Source

pub fn nodes(&self) -> impl Iterator<Item = (&NodeUri, &ResolvedNode)>

Enumerate occurrences with their canonical addresses, including equal semantic subtrees at distinct positions.

Source

pub fn address_for( &self, root: &NodeRoot, steps: &[NodeStep], ) -> Result<NodeUri, NodeResolutionError>

Return the canonical current URI for a known typed path, including a computed guard when that path enters ordered children.

Trait Implementations§

Source§

impl Debug for NodeIndex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.