pub struct PeerSlot { /* private fields */ }Expand description
A #[peer] slot as routing holds it: reached as <parent>.<slot>, its
children are the peers the slot’s function returns by name — a typed
slot’s checked against its interface first (ShapeMismatch by interface
hash). <parent>.<slot>.<name>.<method> is a peer’s method.
Implementations§
Source§impl PeerSlot
impl PeerSlot
Sourcepub fn new(
name: impl Into<String>,
interface: Option<Interface>,
find: FindPeer,
) -> Self
pub fn new( name: impl Into<String>, interface: Option<Interface>, find: FindPeer, ) -> Self
The slot name (integration), typed by interface (or not).
Sourcepub fn with_list(self, list: ListPeers) -> Self
pub fn with_list(self, list: ListPeers) -> Self
The slot’s names, listed (#[peer(list = "…")]): its schema lists
each as a child, so a navigator steps to <slot>.<name>.
Sourcepub fn schema(&self) -> PluginSchema
pub fn schema(&self) -> PluginSchema
The slot as a schema: one dynamic child (any name), typed by the slot’s interface.
Trait Implementations§
Source§impl ChildRouter for PeerSlot
impl ChildRouter for PeerSlot
Source§fn router_namespace(&self) -> &str
fn router_namespace(&self) -> &str
Get the namespace of this router (for error messages)
Source§fn router_call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
auth: Option<&'life2 AuthContext>,
raw_ctx: Option<&'life3 RawRequestContext>,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn router_call<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
method: &'life1 str,
params: Value,
auth: Option<&'life2 AuthContext>,
raw_ctx: Option<&'life3 RawRequestContext>,
) -> Pin<Box<dyn Future<Output = Result<PlexusStream, PlexusError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Call a method on this router
Source§fn get_child<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn ChildRouter>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_child<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<Box<dyn ChildRouter>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a child activation instance by name for nested routing
Source§fn peer_child<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn ChildRouter>>, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn peer_child<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<dyn ChildRouter>>, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
NEST-7: the child or peer named
name, or why a peer could not be
returned — what routing asks, so a caller gets a typed error item
(not_grafted, unavailable, shape_mismatch, …), never “not
found”, for a peer that failed. Default: Self::get_child, which
cannot fail. #[plexus_macros::activation] overrides it for an
activation with a #[plexus_macros::peer] slot.Source§fn router_schema(&self) -> Option<PluginSchema>
fn router_schema(&self) -> Option<PluginSchema>
MACRO-20: this router’s own schema, when it has one. Read more
Source§fn capabilities(&self) -> ChildCapabilities
fn capabilities(&self) -> ChildCapabilities
Which optional operations (list / search) this router supports. Read more
Source§fn list_children<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'_, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_children<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'_, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream every child name the router is willing to enumerate. Read more
Source§fn search_children<'life0, 'life1, 'async_trait>(
&'life0 self,
_query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'_, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_children<'life0, 'life1, 'async_trait>(
&'life0 self,
_query: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<BoxStream<'_, String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stream child names matching the router-defined query semantics. Read more
Source§fn forward_policy_for(&self, _callee_ns: &str) -> Option<Arc<dyn ForwardPolicy>>
fn forward_policy_for(&self, _callee_ns: &str) -> Option<Arc<dyn ForwardPolicy>>
Look up the forward policy declared for a callee namespace. Read more
Source§fn router_static_child_schemas(&self) -> Vec<(String, PluginSchema)>
fn router_static_child_schemas(&self) -> Vec<(String, PluginSchema)>
MACRO-20: every static child below this router that describes itself,
as
(path, schema) — path relative to this router, dotted for a
grandchild ("commits", "commits.audit"), schema the child’s own
(its methods’ grants and its roles relative to it, as its macro
wrote them). Read moreSource§fn framework_stamped_principal(&self) -> Principal
fn framework_stamped_principal(&self) -> Principal
Framework-stamped immediate-caller
plexus_auth_core::Principal of
this router. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PeerSlot
impl !UnwindSafe for PeerSlot
impl Forget for PeerSlot
impl Freeze for PeerSlot
impl Send for PeerSlot
impl Sync for PeerSlot
impl Unpin for PeerSlot
impl UnsafeUnpin for PeerSlot
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