fastcs.methods.command#
- fastcs.methods.command.UnboundCommandCallback#
A Command callback that is unbound and must be called with a
Controllerinstancealias of
Callable[[Controller_T],Coroutine[None,None,None]]
- fastcs.methods.command.CommandCallback#
A Command callback that is bound and can be called without
self
- class fastcs.methods.command.Command(fn: Callable[[], Coroutine[None, None, None]], *, group: str | None = None)[source]#
A
ControllerMethodthat performs a single action when called.This class contains a function that is bound to a specific
Controllerinstance and is callable outside of the class context, without an explicitselfparameter. Calling an instance of this class will call the boundControllermethod.
- class fastcs.methods.command.UnboundCommand(fn: Callable[[Controller_T], Coroutine[None, None, None]], *, group: str | None = None)[source]#
A wrapper of an unbound
Controllermethod to be bound into aCommand.This generic class stores an unbound
Controllermethod - effectively a function that takes an instance of a specificControllertype (Controller_T). Instances of this class can be added atControllerdefinition, either manually or with use of thecommandwrapper, to register the method to be included in the API of theController. When theControlleris instantiated, these instances will be bound to the instance, creating aCommandinstance.
- fastcs.methods.command.command(*, group: str | None = None) Callable[[Callable[[Controller_T], Coroutine[None, None, None]]], Callable[[Controller_T], Coroutine[None, None, None]]][source]#
Decorator to register a
Controllermethod as aCommandThe
Commandwill be passed to the transport layer to expose in the API- Param:
group: Group to display this command under in the transport layer