pub trait DeclaredCommands: Sized {
// Required method
fn register_declared_command(
self,
activity_type: impl Into<String>,
action: ShellAction,
) -> Result<Self, WorkerError>;
}Expand description
Offering declared commands as activities.
Required Methods§
Sourcefn register_declared_command(
self,
activity_type: impl Into<String>,
action: ShellAction,
) -> Result<Self, WorkerError>
fn register_declared_command( self, activity_type: impl Into<String>, action: ShellAction, ) -> Result<Self, WorkerError>
Register action to be served under activity_type.
§Errors
Returns WorkerError::Registration when activity_type already has
a registered handler. A declared action never silently displaces a
hand-written one: a name collision is a deployment mistake worth
refusing, because the wrong body would otherwise run under the right
name.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".