pub struct CallbackManager { /* private fields */ }Expand description
Manages callback lifecycle including timeouts and heartbeats.
Implementations§
Source§impl CallbackManager
impl CallbackManager
Sourcepub fn register_callback(
&mut self,
callback_id: &str,
timeout: Option<Duration>,
) -> Result<(), TestError>
pub fn register_callback( &mut self, callback_id: &str, timeout: Option<Duration>, ) -> Result<(), TestError>
Register a new callback.
Sourcepub fn send_success(
&mut self,
callback_id: &str,
result: &str,
) -> Result<(), TestError>
pub fn send_success( &mut self, callback_id: &str, result: &str, ) -> Result<(), TestError>
Send callback success.
Sourcepub fn send_failure(
&mut self,
callback_id: &str,
error: &ErrorObject,
) -> Result<(), TestError>
pub fn send_failure( &mut self, callback_id: &str, error: &ErrorObject, ) -> Result<(), TestError>
Send callback failure.
Sourcepub fn send_heartbeat(&mut self, callback_id: &str) -> Result<(), TestError>
pub fn send_heartbeat(&mut self, callback_id: &str) -> Result<(), TestError>
Send callback heartbeat.
Sourcepub fn check_timeouts(&mut self) -> Vec<String>
pub fn check_timeouts(&mut self) -> Vec<String>
Check for timed out callbacks and mark them as timed out. Returns the IDs of callbacks that timed out.
Sourcepub fn get_callback_status(
&self,
callback_id: &str,
) -> Option<CompleteCallbackStatus>
pub fn get_callback_status( &self, callback_id: &str, ) -> Option<CompleteCallbackStatus>
Get callback status.
Sourcepub fn get_callback_state(&self, callback_id: &str) -> Option<&CallbackState>
pub fn get_callback_state(&self, callback_id: &str) -> Option<&CallbackState>
Get callback state.
Sourcepub fn execution_id(&self) -> &str
pub fn execution_id(&self) -> &str
Get the execution ID.
Trait Implementations§
Source§impl Debug for CallbackManager
impl Debug for CallbackManager
Source§impl Default for CallbackManager
impl Default for CallbackManager
Source§fn default() -> CallbackManager
fn default() -> CallbackManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CallbackManager
impl RefUnwindSafe for CallbackManager
impl Send for CallbackManager
impl Sync for CallbackManager
impl Unpin for CallbackManager
impl UnsafeUnpin for CallbackManager
impl UnwindSafe for CallbackManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.