#[non_exhaustive]pub enum MethodRole {
Rpc,
StaticChild,
DynamicChild {
list_method: Option<String>,
search_method: Option<String>,
child: Option<Box<PluginSchema>>,
},
Peer {
list_method: Option<String>,
search_method: Option<String>,
interface: Option<Interface>,
},
}Expand description
Describes how a method participates in the activation graph.
Every method on a plugin is exactly one of three kinds:
Rpc— a regular RPC endpoint (the default).StaticChild— the method returns a child activation by a static name (no lookup argument). Used by#[child]-annotated methods on hubs.DynamicChild { .. }— the method gates a dynamic child keyed by its argument.list_methodoptionally names a sibling method that enumerates available keys, andsearch_methodoptionally names a sibling method that searches keys.
This tag is consumed by downstream tooling (synapse, synapse-cc,
introspection clients) to reconstruct the child graph without a separate
side-table. Today’s macros emit MethodRole::Rpc for every method; IR-3
populates child roles from #[child] annotations.
§Wire back-compat
Added in IR-2. Serde defaults to Rpc for pre-IR schemas.
#[non_exhaustive] reserves space for future variants without breaking
downstream match arms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rpc
Method is an RPC endpoint (the default for ordinary methods).
StaticChild
Method returns a child activation by static name (no lookup arg).
DynamicChild
Method gates a dynamic child keyed by its argument.
Fields
child: Option<Box<PluginSchema>>NEST-5: the slot’s type — the schema every instance in the slot
serves (fn item(&self, name: &str) -> Option<Item>: Item’s).
Absent for an untyped slot (#[child(opaque)], a hand-written
router), which the gate admits whole (tickets.{item}).
Peer
NEST-7: a peer slot — #[plexus_macros::peer] async fn x(&self, name: &str) -> Result<Box<dyn I>, PeerError>: an activation returned by
name, in this process or across the network. interface is the
slot’s type (None: an untyped peer, admitted whole). It is reached
as <parent>.<slot>.<name>: on the wire it is a static_child (the
slot, whose own schema is one dynamic child — any name) marked
peer: true beside its interface, so a reader that knows only
static and dynamic children navigates it.
Implementations§
Source§impl MethodRole
impl MethodRole
Sourcepub fn is_slot(&self) -> bool
pub fn is_slot(&self) -> bool
NEST-5/NEST-7: whether this role names a slot — a child or a peer found by name at call time.
Sourcepub fn slot_schema(&self) -> Option<PluginSchema>
pub fn slot_schema(&self) -> Option<PluginSchema>
NEST-5: the slot’s type as a schema (a typed dynamic child’s
child); None for an untyped slot or a role that is no slot.
Trait Implementations§
Source§impl Clone for MethodRole
impl Clone for MethodRole
Source§impl Debug for MethodRole
impl Debug for MethodRole
Source§impl Default for MethodRole
impl Default for MethodRole
Source§impl<'de> Deserialize<'de> for MethodRole
impl<'de> Deserialize<'de> for MethodRole
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
impl Eq for MethodRole
Source§impl JsonSchema for MethodRole
impl JsonSchema for MethodRole
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for MethodRole
impl PartialEq for MethodRole
Source§impl Serialize for MethodRole
impl Serialize for MethodRole
impl StructuralPartialEq for MethodRole
Auto Trait Implementations§
impl Forget for MethodRole
impl Freeze for MethodRole
impl RefUnwindSafe for MethodRole
impl Send for MethodRole
impl Sync for MethodRole
impl Unpin for MethodRole
impl UnsafeUnpin for MethodRole
impl UnwindSafe for MethodRole
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.