Skip to main content

ChildConfig

Struct ChildConfig 

Source
pub struct ChildConfig {
    pub serdes: Option<Arc<dyn SerDesAny>>,
    pub replay_children: bool,
    pub error_mapper: Option<Arc<dyn Fn(DurableError) -> DurableError + Send + Sync>>,
    pub summary_generator: Option<Arc<dyn Fn(&str) -> String + Send + Sync>>,
}
Expand description

Configuration for child context operations.

This configuration controls how child contexts behave, including whether to replay children when loading state for large parallel operations.

§Requirements

  • 10.5: THE Child_Context_Operation SHALL support ReplayChildren option for large parallel operations
  • 10.6: WHEN ReplayChildren is true, THE Child_Context_Operation SHALL include child operations in state loads for replay
  • 12.8: THE Configuration_System SHALL provide ContextConfig with replay_children option

Fields§

§serdes: Option<Arc<dyn SerDesAny>>

Optional custom serializer/deserializer.

§replay_children: bool

Whether to replay children when loading state.

When set to true, the child context will request child operations to be included in state loads during replay. This is useful for large parallel operations where the combined output needs to be reconstructed by replaying each branch.

Default is false for better performance in most cases.

§Requirements

  • 10.5: THE Child_Context_Operation SHALL support ReplayChildren option for large parallel operations
  • 10.6: WHEN ReplayChildren is true, THE Child_Context_Operation SHALL include child operations in state loads for replay
§error_mapper: Option<Arc<dyn Fn(DurableError) -> DurableError + Send + Sync>>

Optional function to map child context errors before propagation.

When set, this function is applied to errors from child context execution before they are checkpointed and propagated. Suspend errors are never mapped.

Default is None, which preserves current behavior (errors propagate unchanged).

§Requirements

  • 6.1: error_mapper applied to errors before checkpointing and propagation
  • 6.2: None preserves current behavior
  • 6.3: Suspend errors skip the mapper
§summary_generator: Option<Arc<dyn Fn(&str) -> String + Send + Sync>>

Optional function to generate a summary when the serialized child result exceeds 256KB.

When set, this function is invoked with the serialized result string if its size exceeds 256KB (262144 bytes). The returned summary string is stored instead of the full result, enabling replay-based reconstruction for large payloads.

When the serialized result is 256KB or less, the full result is stored even if a summary generator is configured.

Default is None, which preserves current behavior (full result stored regardless of size).

§Requirements

  • 7.1: summary_generator invoked when result > 256KB
  • 7.2: summary_generator NOT invoked when result <= 256KB
  • 7.3: None preserves current behavior

Implementations§

Source§

impl ChildConfig

Source

pub fn new() -> Self

Creates a new ChildConfig with default values.

Source

pub fn with_replay_children() -> Self

Creates a ChildConfig with replay_children enabled.

Use this when you need to reconstruct the combined output of a large parallel operation by replaying each branch.

§Example
use durable_execution_sdk::ChildConfig;

let config = ChildConfig::with_replay_children();
assert!(config.replay_children);
Source

pub fn set_replay_children(self, replay_children: bool) -> Self

Sets the replay_children option.

§Arguments
  • replay_children - Whether to replay children when loading state
Source

pub fn set_serdes(self, serdes: Arc<dyn SerDesAny>) -> Self

Sets the custom serializer/deserializer.

Source

pub fn set_error_mapper( self, mapper: Arc<dyn Fn(DurableError) -> DurableError + Send + Sync>, ) -> Self

Sets the error mapper function.

The error mapper is applied to child context errors before they are checkpointed and propagated. Suspend errors are never mapped.

§Requirements
  • 6.1: error_mapper applied to errors before checkpointing and propagation
Source

pub fn set_summary_generator( self, generator: Arc<dyn Fn(&str) -> String + Send + Sync>, ) -> Self

Sets the summary generator function.

The summary generator is invoked when the serialized child result exceeds 256KB (262144 bytes). It receives the serialized result string and should return a compact summary string to store instead.

§Requirements
  • 7.1: summary_generator invoked when result > 256KB

Trait Implementations§

Source§

impl Clone for ChildConfig

Source§

fn clone(&self) -> ChildConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ChildConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ChildConfig

Source§

fn default() -> ChildConfig

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more