pub struct CapabilityResolver { /* private fields */ }Expand description
Resolves local and discovered providers and enforces capability requirements.
Implementations§
Source§impl CapabilityResolver
impl CapabilityResolver
Sourcepub fn new(registry: CapabilityRegistry) -> Self
pub fn new(registry: CapabilityRegistry) -> Self
Creates a resolver backed by a local registry.
Sourcepub fn with_peers(self, peers: Vec<PeerRecord>) -> Self
pub fn with_peers(self, peers: Vec<PeerRecord>) -> Self
Adds the current discovery snapshot used for remote resolution.
Sourcepub fn with_selector(self, selector: Arc<dyn CapabilitySelectionPolicy>) -> Self
pub fn with_selector(self, selector: Arc<dyn CapabilitySelectionPolicy>) -> Self
Replaces the default provider selection policy.
Sourcepub fn resolve(
&self,
identity: &CoreIdentity,
service_id: &ServiceId,
request: &CapabilityRequest,
leadership: Option<&dyn ServiceLeadershipGuard>,
now_ms: u64,
) -> CapabilityResult<CapabilityProvider>
pub fn resolve( &self, identity: &CoreIdentity, service_id: &ServiceId, request: &CapabilityRequest, leadership: Option<&dyn ServiceLeadershipGuard>, now_ms: u64, ) -> CapabilityResult<CapabilityProvider>
Resolves a provider and checks leadership for the declared service.
Sourcepub fn handle_local(
&self,
identity: &CoreIdentity,
service_id: &ServiceId,
request: &CapabilityRequest,
leadership: Option<&dyn ServiceLeadershipGuard>,
now_ms: u64,
) -> CapabilityResult<CapabilityResponse>
pub fn handle_local( &self, identity: &CoreIdentity, service_id: &ServiceId, request: &CapabilityRequest, leadership: Option<&dyn ServiceLeadershipGuard>, now_ms: u64, ) -> CapabilityResult<CapabilityResponse>
Handles a local capability using service-scoped leadership.
Sourcepub fn handle(
&self,
identity: &CoreIdentity,
service_id: &ServiceId,
request: &CapabilityRequest,
leadership: Option<&dyn ServiceLeadershipGuard>,
remote_invoker: Option<&dyn RemoteCapabilityInvoker>,
now_ms: u64,
) -> CapabilityResult<CapabilityResponse>
pub fn handle( &self, identity: &CoreIdentity, service_id: &ServiceId, request: &CapabilityRequest, leadership: Option<&dyn ServiceLeadershipGuard>, remote_invoker: Option<&dyn RemoteCapabilityInvoker>, now_ms: u64, ) -> CapabilityResult<CapabilityResponse>
Handles a local or remote capability using service-scoped leadership.
Sourcepub fn handle_owned(
&self,
identity: &CoreIdentity,
service_id: &ServiceId,
request: CapabilityRequest,
leadership: Option<&dyn ServiceLeadershipGuard>,
remote_invoker: Option<&dyn RemoteCapabilityInvoker>,
now_ms: u64,
) -> CapabilityResult<CapabilityResponse>
pub fn handle_owned( &self, identity: &CoreIdentity, service_id: &ServiceId, request: CapabilityRequest, leadership: Option<&dyn ServiceLeadershipGuard>, remote_invoker: Option<&dyn RemoteCapabilityInvoker>, now_ms: u64, ) -> CapabilityResult<CapabilityResponse>
Handles an owned local or remote request using service-scoped leadership.
Local handlers retain their borrowed contract. A remote invoker may transfer the request fields directly into its transport.
Auto Trait Implementations§
impl !RefUnwindSafe for CapabilityResolver
impl !UnwindSafe for CapabilityResolver
impl Freeze for CapabilityResolver
impl Send for CapabilityResolver
impl Sync for CapabilityResolver
impl Unpin for CapabilityResolver
impl UnsafeUnpin for CapabilityResolver
Blanket Implementations§
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
Mutably borrows from an owned value. Read more