pub struct AgentServer;Expand description
Static functions for AgentServer management.
AgentServer hosts custom recognitions and actions that can be accessed remotely by AgentClient instances.
Implementations§
Source§impl AgentServer
impl AgentServer
Sourcepub fn register_custom_recognition(
name: &str,
reco: Box<dyn CustomRecognition>,
) -> MaaResult<()>
pub fn register_custom_recognition( name: &str, reco: Box<dyn CustomRecognition>, ) -> MaaResult<()>
Register a custom recognition with the AgentServer.
The recognition will be available to connected AgentClients.
Sourcepub fn register_custom_action(
name: &str,
action: Box<dyn CustomAction>,
) -> MaaResult<()>
pub fn register_custom_action( name: &str, action: Box<dyn CustomAction>, ) -> MaaResult<()>
Register a custom action with the AgentServer.
The action will be available to connected AgentClients.
Sourcepub fn add_resource_sink<F>(callback: F) -> MaaResult<MaaSinkId>
pub fn add_resource_sink<F>(callback: F) -> MaaResult<MaaSinkId>
Add a resource event sink.
Sourcepub fn add_controller_sink<F>(callback: F) -> MaaResult<MaaSinkId>
pub fn add_controller_sink<F>(callback: F) -> MaaResult<MaaSinkId>
Add a controller event sink.
Sourcepub fn add_tasker_sink<F>(callback: F) -> MaaResult<MaaSinkId>
pub fn add_tasker_sink<F>(callback: F) -> MaaResult<MaaSinkId>
Add a tasker event sink.
Sourcepub fn add_context_sink<F>(callback: F) -> MaaResult<MaaSinkId>
pub fn add_context_sink<F>(callback: F) -> MaaResult<MaaSinkId>
Add a context event sink.
Auto Trait Implementations§
impl Freeze for AgentServer
impl RefUnwindSafe for AgentServer
impl Send for AgentServer
impl Sync for AgentServer
impl Unpin for AgentServer
impl UnwindSafe for AgentServer
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