Skip to main content

AtomResolver

Struct AtomResolver 

Source
pub struct AtomResolver<'a> { /* private fields */ }
Expand description

Resolves a Grounded edge target to the foreign atom it names, by content-address agreement across the loaded connected archives.

Built once from a manifest + the supplied peer archives, gated so every declared ontology’s archive matches its pinned root. Each connected ontology is indexed by its nodes’ definition-bearing addresses, so resolution is an O(log n) lookup, never a scan.

Implementations§

Source§

impl<'a> AtomResolver<'a>

Source

pub fn new( manifest: &ConnectedOntologies, peers: &'a BTreeMap<String, Archive>, ) -> Result<Self, LinkError>

Build the resolver from the manifest and the loaded peers (by name).

Fail-closed: a declared ontology with no supplied archive is MissingPeerArchive; a supplied archive whose root disagrees with the pinned root is RootMismatch. Only after every pin agrees is any atom index built.

Source

pub fn resolve(&self, target: &EdgeTarget) -> Result<&'a Definition, LinkError>

Resolve a grounded edge target to its foreign atom. Fail-closed: an undeclared ontology or an absent atom returns a typed LinkError, never a silent miss. A Local target is NotGrounded — there is nothing foreign to resolve.

Trait Implementations§

Source§

impl<'a> Debug for AtomResolver<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for AtomResolver<'a>

§

impl<'a> RefUnwindSafe for AtomResolver<'a>

§

impl<'a> Send for AtomResolver<'a>

§

impl<'a> Sync for AtomResolver<'a>

§

impl<'a> Unpin for AtomResolver<'a>

§

impl<'a> UnsafeUnpin for AtomResolver<'a>

§

impl<'a> UnwindSafe for AtomResolver<'a>

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<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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.