pub enum ChildResult {
Ok(Value),
Err(ChildError),
Aborted,
}Expand description
Result of a Child’s work execution.
Represents the outcome of RunnableChild::run().
For serialization, convert to ChildResultDto using .into().
§Variants
Ok: Work completed successfully with optional output dataErr: Work failed with a typed errorAborted: Work was interrupted by a Signal (Veto/Cancel)
§Example
use orcs_component::{ChildResult, ChildError};
use serde_json::json;
let success = ChildResult::Ok(json!({"processed": true}));
assert!(success.is_ok());
let failure = ChildResult::Err(ChildError::Timeout { elapsed_ms: 5000 });
assert!(failure.is_err());
let aborted = ChildResult::Aborted;
assert!(aborted.is_aborted());Variants§
Ok(Value)
Work completed successfully.
Err(ChildError)
Work failed with a typed error.
Aborted
Work was aborted by a Signal.
Implementations§
Source§impl ChildResult
impl ChildResult
Sourcepub fn is_aborted(&self) -> bool
pub fn is_aborted(&self) -> bool
Returns true if the result is Aborted.
Sourcepub fn err(self) -> Option<ChildError>
pub fn err(self) -> Option<ChildError>
Returns the error if Err, otherwise None.
Trait Implementations§
Source§impl Clone for ChildResult
impl Clone for ChildResult
Source§fn clone(&self) -> ChildResult
fn clone(&self) -> ChildResult
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 moreSource§impl Debug for ChildResult
impl Debug for ChildResult
Source§impl Default for ChildResult
impl Default for ChildResult
Source§impl From<&ChildResult> for RunResult
impl From<&ChildResult> for RunResult
Source§fn from(result: &ChildResult) -> Self
fn from(result: &ChildResult) -> Self
Converts to this type from the input type.
Source§impl From<ChildError> for ChildResult
impl From<ChildError> for ChildResult
Source§fn from(err: ChildError) -> Self
fn from(err: ChildError) -> Self
Converts to this type from the input type.
Source§impl From<ChildResult> for ChildResultDto
impl From<ChildResult> for ChildResultDto
Source§fn from(result: ChildResult) -> Self
fn from(result: ChildResult) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ChildResult
impl RefUnwindSafe for ChildResult
impl Send for ChildResult
impl Sync for ChildResult
impl Unpin for ChildResult
impl UnsafeUnpin for ChildResult
impl UnwindSafe for ChildResult
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