pub struct OneOffActuatorAgent { /* private fields */ }Expand description
Ephemeral actor that resolves and executes one-shot HA service calls.
Spawned on demand by the orchestrator. Exits after processing a single message, matching the Python implementation’s lifecycle.
Implementations§
Source§impl OneOffActuatorAgent
impl OneOffActuatorAgent
Sourcepub fn new(config: ActorConfig, task_id: String, reply_to_id: String) -> Self
pub fn new(config: ActorConfig, task_id: String, reply_to_id: String) -> Self
Create a new OneOffActuatorAgent for the given task_id.
The actor name is derived from the last 8 characters of task_id,
matching the Python naming convention.
Sourcepub fn with_publisher(self, p: EventPublisher) -> Self
pub fn with_publisher(self, p: EventPublisher) -> Self
Attach an event publisher for MQTT output.
Sourcepub fn with_ha_config(self, url: String, token: String) -> Self
pub fn with_ha_config(self, url: String, token: String) -> Self
Configure the Home Assistant base URL and long-lived access token.
Trait Implementations§
Source§impl Actor for OneOffActuatorAgent
impl Actor for OneOffActuatorAgent
Source§fn state(&self) -> ActorState
fn state(&self) -> ActorState
Return the current lifecycle state.
Source§fn metrics(&self) -> Arc<ActorMetrics>
fn metrics(&self) -> Arc<ActorMetrics>
Return a reference to this actor’s metrics.
Source§fn is_protected(&self) -> bool
fn is_protected(&self) -> bool
Return whether this actor is protected from external kill commands.
Source§fn on_start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called once after the actor is created, before the message loop starts.
Source§fn handle_message<'life0, 'async_trait>(
&'life0 mut self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_message<'life0, 'async_trait>(
&'life0 mut self,
message: Message,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called with each incoming message from the mailbox.
Source§fn run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drive the actor’s main loop. Read more
Auto Trait Implementations§
impl Freeze for OneOffActuatorAgent
impl RefUnwindSafe for OneOffActuatorAgent
impl Send for OneOffActuatorAgent
impl Sync for OneOffActuatorAgent
impl Unpin for OneOffActuatorAgent
impl UnwindSafe for OneOffActuatorAgent
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