pub struct Call<F: Function> { /* private fields */ }Expand description
One call of a function, waiting to be awaited: what call returns.
It is IntoFuture, so .await runs it, and the future is Send and
'static, so a test may also spawn it.
Implementations§
Source§impl<F: Function> Call<F>
impl<F: Function> Call<F>
Sourcepub fn message(self, m: Message) -> Self
pub fn message(self, m: Message) -> Self
The message the call runs over. By default an empty one: a null
payload and empty roots.
Sourcepub fn layer<L: CallLayer>(self, l: L) -> Self
pub fn layer<L: CallLayer>(self, l: L) -> Self
Adds a layer around the call, as a run’s layers wrap a call. The first given is the outermost.
Sourcepub fn exprs(self, e: ExprEngine) -> Self
pub fn exprs(self, e: ExprEngine) -> Self
The engine the config compiles with and the call evaluates with,
secrets included. By default ExprEngine::default.
Sourcepub fn name(self, n: &str) -> Self
pub fn name(self, n: &str) -> Self
The name the function is registered and called by: what Prepare
and CallInfo::function say. By default "function"; a built-in’s
name is reserved, as Registry::register reserves it.
Sourcepub fn capture_changes(self, on: bool) -> Self
pub fn capture_changes(self, on: bool) -> Self
Whether the call records its Changes, as a run’s
capture_changes says.
On by default.
Sourcepub fn channel(self, c: &str) -> Self
pub fn channel(self, c: &str) -> Self
The channel the call’s run was started on, as
CallInfo::channel says. By default none.
Sourcepub fn routing_bucket(self, b: u8) -> Self
pub fn routing_bucket(self, b: u8) -> Self
The run’s routing bucket, as CallInfo::routing_bucket says. By
default none.
Sourcepub fn deadline(self, at: Instant) -> Self
pub fn deadline(self, at: Instant) -> Self
The run’s deadline, as Ctx::deadline says.
The call is checked against it and, natively, raced against it, as
a run’s host call is: one it passes ends Err of kind
TimedOut, its writes dropped. A deadline
needs a Tokio runtime with its time driver. By default none.
Sourcepub fn cancel(self, token: CancelToken) -> Self
pub fn cancel(self, token: CancelToken) -> Self
The run’s cancellation token, as Ctx::cancel
says. The call is checked against it and, natively, raced against
it, as a run’s host call is: one it cancels ends Err of kind
Cancelled, its writes dropped. By default
none.