pub struct CallbackOptions { /* private fields */ }Expand description
Configure callback timeout behavior.
Provide a builder-style API for configuring callback operations. By default, no timeouts are set — the callback remains active indefinitely until an external system signals success or failure.
§Examples
use durable_lambda_core::types::CallbackOptions;
// No timeouts (default).
let opts = CallbackOptions::new();
// 5-minute overall timeout, 30-second heartbeat timeout.
let opts = CallbackOptions::new()
.timeout_seconds(300)
.heartbeat_timeout_seconds(30);Implementations§
Source§impl CallbackOptions
impl CallbackOptions
Sourcepub fn new() -> CallbackOptions
pub fn new() -> CallbackOptions
Create a new CallbackOptions with no timeouts configured.
§Examples
use durable_lambda_core::types::CallbackOptions;
let opts = CallbackOptions::new();Sourcepub fn timeout_seconds(self, seconds: i32) -> CallbackOptions
pub fn timeout_seconds(self, seconds: i32) -> CallbackOptions
Set the overall timeout in seconds for the callback.
If no success/failure signal arrives before this deadline, the server marks the callback as timed out. Must be a positive value. To use no timeout, omit this setter entirely.
§Panics
Panics if seconds is 0 or negative.
§Examples
use durable_lambda_core::types::CallbackOptions;
let opts = CallbackOptions::new().timeout_seconds(300);Sourcepub fn heartbeat_timeout_seconds(self, seconds: i32) -> CallbackOptions
pub fn heartbeat_timeout_seconds(self, seconds: i32) -> CallbackOptions
Set the heartbeat timeout in seconds.
External systems must send periodic heartbeat signals within this interval to keep the callback alive. Must be a positive value. To use no heartbeat requirement, omit this setter entirely.
§Panics
Panics if seconds is 0 or negative.
§Examples
use durable_lambda_core::types::CallbackOptions;
let opts = CallbackOptions::new().heartbeat_timeout_seconds(30);Sourcepub fn get_timeout_seconds(&self) -> i32
pub fn get_timeout_seconds(&self) -> i32
Return the configured timeout in seconds.
§Examples
use durable_lambda_core::types::CallbackOptions;
let opts = CallbackOptions::new();
assert_eq!(opts.get_timeout_seconds(), 0);
let opts = CallbackOptions::new().timeout_seconds(300);
assert_eq!(opts.get_timeout_seconds(), 300);Sourcepub fn get_heartbeat_timeout_seconds(&self) -> i32
pub fn get_heartbeat_timeout_seconds(&self) -> i32
Return the configured heartbeat timeout in seconds.
§Examples
use durable_lambda_core::types::CallbackOptions;
let opts = CallbackOptions::new();
assert_eq!(opts.get_heartbeat_timeout_seconds(), 0);
let opts = CallbackOptions::new().heartbeat_timeout_seconds(30);
assert_eq!(opts.get_heartbeat_timeout_seconds(), 30);Trait Implementations§
Source§impl Clone for CallbackOptions
impl Clone for CallbackOptions
Source§fn clone(&self) -> CallbackOptions
fn clone(&self) -> CallbackOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CallbackOptions
impl Debug for CallbackOptions
Source§impl Default for CallbackOptions
impl Default for CallbackOptions
Source§fn default() -> CallbackOptions
fn default() -> CallbackOptions
Auto Trait Implementations§
impl Freeze for CallbackOptions
impl RefUnwindSafe for CallbackOptions
impl Send for CallbackOptions
impl Sync for CallbackOptions
impl Unpin for CallbackOptions
impl UnsafeUnpin for CallbackOptions
impl UnwindSafe for CallbackOptions
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
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>
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>
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 more