pub struct ActResult {
pub success: bool,
pub action_taken: String,
pub action_type: Option<String>,
pub screenshot: Option<String>,
pub error: Option<String>,
pub usage: AutomationUsage,
}Expand description
Result of a single action execution via act().
Fields§
§success: boolWhether the action was executed successfully.
action_taken: StringDescription of the action that was taken.
action_type: Option<String>The specific action executed (if any).
screenshot: Option<String>Base64-encoded screenshot after the action.
error: Option<String>Error message if the action failed.
usage: AutomationUsageToken usage for this action.
Implementations§
Source§impl ActResult
impl ActResult
Sourcepub fn success(action_taken: impl Into<String>) -> ActResult
pub fn success(action_taken: impl Into<String>) -> ActResult
Create a successful action result.
Sourcepub fn with_action_type(self, action_type: impl Into<String>) -> ActResult
pub fn with_action_type(self, action_type: impl Into<String>) -> ActResult
Set the action type.
Sourcepub fn with_screenshot(self, screenshot: impl Into<String>) -> ActResult
pub fn with_screenshot(self, screenshot: impl Into<String>) -> ActResult
Set the screenshot.
Sourcepub fn with_usage(self, usage: AutomationUsage) -> ActResult
pub fn with_usage(self, usage: AutomationUsage) -> ActResult
Set usage stats.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ActResult
impl<'de> Deserialize<'de> for ActResult
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActResult, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ActResult
impl Serialize for ActResult
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ActResult
impl RefUnwindSafe for ActResult
impl Send for ActResult
impl Sync for ActResult
impl Unpin for ActResult
impl UnsafeUnpin for ActResult
impl UnwindSafe for ActResult
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