ParentContext

Trait ParentContext 

Source
pub trait ParentContext {
    // Required methods
    fn fork(&self) -> Context;
    fn fork_with_deadline(&self, deadline: Instant) -> Context;

    // Provided method
    fn fork_with_timeout(&self, timeout: Duration) -> Context { ... }
}
Expand description

Describes an object from which a child context can be created. Implemented for contexts and for slices of contexts.

Required Methods§

Source

fn fork(&self) -> Context

Forks a context. The new context’s parent(s) are self.

Source

fn fork_with_deadline(&self, deadline: Instant) -> Context

Forks a context. Equivalent to Self::fork(), except that the new context has a deadline which is the earliest of those in self and the one provided.

Provided Methods§

Source

fn fork_with_timeout(&self, timeout: Duration) -> Context

Forks a context. Equivalent to Self::fork_with_deadline(), except that the deadline is calculated from the current time and the provided timeout duration.

Implementations on Foreign Types§

Source§

impl ParentContext for [&Context]

Source§

fn fork(&self) -> Context

Source§

fn fork_with_deadline(&self, deadline: Instant) -> Context

Implementors§