Skip to main content

CapabilityRouter

Struct CapabilityRouter 

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

State-aware capability routing engine

Implementations§

Source§

impl CapabilityRouter

Source

pub fn new() -> Self

Source

pub fn register_local(&mut self, ad: DistributedCapabilityAdvertisement)

Register a local capability

Source

pub fn register_remote(&mut self, ad: DistributedCapabilityAdvertisement)

Register a remote capability

Source

pub fn update_peer_state( &mut self, peer_id: String, namespace: String, version: u64, )

Update peer state version

Source

pub fn get_peer_state_version(&self, peer_id: &str, namespace: &str) -> u64

Get the state version a peer has for a namespace

Source

pub fn route( &self, cap_ref: &CapabilityRef, required_state_version: u64, local_peer_id: &str, ) -> RouteDecision

Route a capability execution request

Source

pub fn find_compatible_providers( &self, cap_ref: &CapabilityRef, required_state_version: u64, ) -> Vec<&DistributedCapabilityAdvertisement>

Find providers with compatible state versions

Source

pub fn requires_state_acquisition( &self, provider_peer: &str, cap_ref: &CapabilityRef, required_state_version: u64, ) -> bool

Check if capability requires state acquisition

Source

pub fn plan_state_acquisition( &self, provider_peer: &str, cap_ref: &CapabilityRef, required_state_version: u64, ) -> Vec<String>

Plan state acquisition - list namespaces that need to be acquired

Trait Implementations§

Source§

impl Default for CapabilityRouter

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<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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V