pub struct Controller { /* private fields */ }
Expand description
Remote controller for the plugin
Wraps the message-based communication with the plugin into asynchronous functions.
Implementations§
Source§impl Controller
impl Controller
pub const fn new(message_tx: MessageSender) -> Self
pub async fn command_replace_config( &self, new_config: Config, ) -> PluginResult<Config>
pub async fn command_switch_state(&self, new_state: State) -> PluginResult<()>
pub async fn command_record_entry( &self, new_entry: Entry, ) -> PluginResult<RecordEntryOutcome>
pub async fn command_shutdown(&self) -> PluginResult<()>
pub async fn query_config(&self) -> PluginResult<Config>
pub async fn query_status(&self, request: StatusRequest) -> PluginResult<Status>
pub async fn query_recent_records( &self, request: RecentRecordsRequest, ) -> PluginResult<Vec<StoredRecord>>
pub async fn query_filter_records( &self, request: FilterRecordsRequest, ) -> PluginResult<Vec<StoredRecord>>
Trait Implementations§
Source§impl Clone for Controller
impl Clone for Controller
Source§fn clone(&self) -> Controller
fn clone(&self) -> Controller
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for Controller
impl RefUnwindSafe for Controller
impl Send for Controller
impl Sync for Controller
impl Unpin for Controller
impl UnwindSafe for Controller
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