pub struct Invocation {
pub start_timestamp: Option<DateTime<Utc>>,
pub end_timestamp: Option<DateTime<Utc>>,
pub request_id: Option<String>,
pub error: Option<TestResultError>,
}Expand description
Information about a single handler invocation.
Tracks timing and error information for each time the handler was invoked during a durable execution.
§Examples
use durable_execution_sdk_testing::Invocation;
let invocation = Invocation::new();
assert!(invocation.start_timestamp.is_none());
assert!(invocation.error.is_none());Fields§
§start_timestamp: Option<DateTime<Utc>>Timestamp when the invocation started
end_timestamp: Option<DateTime<Utc>>Timestamp when the invocation ended
request_id: Option<String>Request ID for this invocation (e.g., Lambda request ID)
error: Option<TestResultError>Error information if the invocation failed
Implementations§
Source§impl Invocation
impl Invocation
Sourcepub fn with_start(start: DateTime<Utc>) -> Self
pub fn with_start(start: DateTime<Utc>) -> Self
Creates a new Invocation with the given start timestamp.
Sourcepub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
Sets the request ID.
Sourcepub fn with_error(self, error: TestResultError) -> Self
pub fn with_error(self, error: TestResultError) -> Self
Sets the error.
Trait Implementations§
Source§impl Clone for Invocation
impl Clone for Invocation
Source§fn clone(&self) -> Invocation
fn clone(&self) -> Invocation
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 Invocation
impl Debug for Invocation
Source§impl Default for Invocation
impl Default for Invocation
Source§impl<'de> Deserialize<'de> for Invocation
impl<'de> Deserialize<'de> for Invocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Invocation
impl RefUnwindSafe for Invocation
impl Send for Invocation
impl Sync for Invocation
impl Unpin for Invocation
impl UnsafeUnpin for Invocation
impl UnwindSafe for Invocation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
impl<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
Source§fn into_response(self) -> FunctionResponse<B, Body>
fn into_response(self) -> FunctionResponse<B, Body>
Convert the type into a FunctionResponse.
Creates a shared type from an unshared type.