Skip to main content

InterfaceRegistry

Struct InterfaceRegistry 

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

Registry of frozen definition artifacts and explicitly scoped registrations.

Artifact retention is not proof of current publication. Fetch requires a live provider-attested ScopeObservation; execution requires the same lifetime in the target’s atomic boundary. Collision keys are exact (scope, name) pairs, not Rust TypeId: the same Definition can be registered at multiple coordinates.

Implementations§

Source§

impl InterfaceRegistry

Source

pub fn new() -> Self

Creates an empty artifact registry without publishing any Object.

Source

pub fn register<D>( &mut self, scope: &Scope, name: impl Into<String>, _definition: D, validator: Option<Validator>, ) -> Result<RegisteredInterface<D>, RegistrationError>
where D: InterfaceDefinition + 'static,

Freezes a Definition at an explicit scope and local name.

Source

pub fn remove_scope(&mut self, scope: &Scope)

Ends a scope lifetime and releases its registry entries.

Retained tokens cannot start new calls/fetches. Started calls retain their frozen Descriptor. Re-publication requires a fresh Scope.

Source

pub fn resolve(&self, reference: &InterfaceReference) -> Option<InterfaceRef>

Resolves a stored artifact, not evidence of current publication.

Source

pub fn scopes(&self) -> impl Iterator<Item = &Scope>

Iterates registered scope handles, possibly repeated for multiple names.

Source

pub fn fetch_interface( &self, reference: &InterfaceReference, current: &ScopeObservation, ) -> Result<InterfaceObservation, ProtocolError>

Fetches only with a coherent current scope Object attestation.

Trait Implementations§

Source§

impl Debug for InterfaceRegistry

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for InterfaceRegistry

Source§

fn default() -> Self

Returns the “default value” for a type. 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<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, 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.