pub struct InvokeRequest<T = Value> {
pub payload: Option<T>,
}Expand description
Structured input wrapper for run(), matching the Node.js SDK’s InvokeRequest.
Wraps an optional payload for handler invocation. Use InvokeRequest::with_payload
to supply input, or InvokeRequest::new for a no-payload invocation.
From<T> is implemented so that raw payloads can be passed directly to run()
without wrapping — backward compatibility is preserved.
§Examples
use durable_execution_sdk_testing::InvokeRequest;
// With a payload
let req = InvokeRequest::with_payload("hello");
assert_eq!(req.payload, Some("hello"));
// Without a payload
let req: InvokeRequest<String> = InvokeRequest::new();
assert!(req.payload.is_none());
// From a raw value (backward compat)
let req: InvokeRequest<i32> = 42.into();
assert_eq!(req.payload, Some(42));Fields§
§payload: Option<T>Optional payload to pass to the handler.
Implementations§
Source§impl<T> InvokeRequest<T>
impl<T> InvokeRequest<T>
Sourcepub fn with_payload(payload: T) -> Self
pub fn with_payload(payload: T) -> Self
Creates a new InvokeRequest with the given payload.
Trait Implementations§
Source§impl<T: Clone> Clone for InvokeRequest<T>
impl<T: Clone> Clone for InvokeRequest<T>
Source§fn clone(&self) -> InvokeRequest<T>
fn clone(&self) -> InvokeRequest<T>
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<T: Debug> Debug for InvokeRequest<T>
impl<T: Debug> Debug for InvokeRequest<T>
Source§impl<T: Default> Default for InvokeRequest<T>
impl<T: Default> Default for InvokeRequest<T>
Source§fn default() -> InvokeRequest<T>
fn default() -> InvokeRequest<T>
Returns the “default value” for a type. Read more
Source§impl<'de, T> Deserialize<'de> for InvokeRequest<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for InvokeRequest<T>where
T: Deserialize<'de>,
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
Source§impl<T> From<T> for InvokeRequest<T>
impl<T> From<T> for InvokeRequest<T>
Auto Trait Implementations§
impl<T> Freeze for InvokeRequest<T>where
T: Freeze,
impl<T> RefUnwindSafe for InvokeRequest<T>where
T: RefUnwindSafe,
impl<T> Send for InvokeRequest<T>where
T: Send,
impl<T> Sync for InvokeRequest<T>where
T: Sync,
impl<T> Unpin for InvokeRequest<T>where
T: Unpin,
impl<T> UnsafeUnpin for InvokeRequest<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for InvokeRequest<T>where
T: UnwindSafe,
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.