#[method]Expand description
Attribute macro for individual methods within a #[plexus::activation] impl block.
§Example
ⓘ
#[plexus::activation] // namespace "bash", implicitly
impl Bash {
/// Execute a bash command
#[plexus::method]
async fn execute(&self, command: String) -> impl Stream<Item = BashEvent> {
// ...
}
}§The return type is the contract (RETURNS-8)
Six forms: -> T, -> Result<T, E>, -> impl Stream<Item = T>,
-> impl Stream<Item = Result<T, E>>, -> impl Stream<Item = Progress<T, P>>, -> impl Stream<Item = Result<Progress<T, P>, E>>. A plain return
yields one item, impl Stream many; Result and Progress are
recognised by name. Any other return type is a compile error that lists
the six. returns(..) is removed (a compile error); streaming is a
deprecated no-op on a stream form and an error on a one-item one.
§Authorization arguments (R-1 / AUTHZ-CORE-2)
scope = "..."— explicit required scope, emitted into the generatedMethodSchema.requires_credential. Repeatable:scope = "x.y", scope = "x.z"means the caller must satisfy ALL listed scopes (conjunction — AND, not OR). Literals are validated at compile time against the AUTHZ-CORE-4 scope grammar (dot-separated[a-z][a-z0-9_]*segments, optional trailing.*segment wildcard, or bare*).input_window = N(BIDIR-6) — on a method with anInput<T>parameter, the credit it grants (default 64).input_max_buffered = N: the bytes held past which it grants no credit until drained (default 64 MiB).input_max_items = N,input_max_bytes = N: limits over the call’s life, none unless given. AnInput<T>is at most one, top-level, and not one of the params:MethodSchema.inputisT’s schema, and the client takes a stream.public— the method is exempt from the default-deny gate; emitted asMethodSchema.public = true. Mixingpublicwithscope = "..."is a compile error (a public method has no required scope to enforce).- Neither — the implicit
<activation>.<method>scope rule applies at registry-build time (AUTHZ-CORE-4); the schema carries norequires_credentialfor the implicit case.