#[repr(C)]pub struct StepResult {
pub tag: StepResultTag,
pub payload: StepResultPayload,
}Expand description
Return value of ToolPollFn. The blocking driver matches on tag, reads
the matching payload, and breaks the loop on Done/Err.
Fields§
§tag: StepResultTag§payload: StepResultPayloadImplementations§
Source§impl StepResult
impl StepResult
Sourcepub fn pending(progress: StbString) -> Self
pub fn pending(progress: StbString) -> Self
Build a Pending with a progress JSON string (may be empty).
Sourcepub unsafe fn pending_payload(&self) -> &StbPending
pub unsafe fn pending_payload(&self) -> &StbPending
Access the pending payload. Caller MUST guarantee tag == Pending.
§Safety
Undefined behavior if tag != StepResultTag::Pending.
Sourcepub unsafe fn done_payload(&self) -> &StbDone
pub unsafe fn done_payload(&self) -> &StbDone
Access the done payload. Caller MUST guarantee tag == Done.
§Safety
Undefined behavior if tag != StepResultTag::Done.
Sourcepub unsafe fn err_payload(&self) -> &StbErr
pub unsafe fn err_payload(&self) -> &StbErr
Access the err payload. Caller MUST guarantee tag == Err.
§Safety
Undefined behavior if tag != StepResultTag::Err.
Trait Implementations§
Source§impl Clone for StepResult
impl Clone for StepResult
Source§fn clone(&self) -> StepResult
fn clone(&self) -> StepResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StepResult
Auto Trait Implementations§
impl Freeze for StepResult
impl RefUnwindSafe for StepResult
impl Send for StepResult
impl Sync for StepResult
impl Unpin for StepResult
impl UnsafeUnpin for StepResult
impl UnwindSafe for StepResult
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