Skip to main content

Call

Struct Call 

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

Source

pub fn message(self, m: Message) -> Self

The message the call runs over. By default an empty one: a null payload and empty roots.

Source

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.

Source

pub fn exprs(self, e: ExprEngine) -> Self

The engine the config compiles with and the call evaluates with, secrets included. By default ExprEngine::default.

Source

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.

Source

pub fn capture_changes(self, on: bool) -> Self

Whether the call records its Changes, as a run’s capture_changes says. On by default.

Source

pub fn channel(self, c: &str) -> Self

The channel the call’s run was started on, as CallInfo::channel says. By default none.

Source

pub fn routing_bucket(self, b: u8) -> Self

The run’s routing bucket, as CallInfo::routing_bucket says. By default none.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<F: Function> Debug for Call<F>

Source§

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

The name, the input, the layer count, whether changes are captured, the channel and the deadline; not the function, the layers or the token.

Source§

impl<F: Function> IntoFuture for Call<F>

Source§

type Output = Called

The output that the future will produce on completion.
Source§

type IntoFuture = Pin<Box<dyn Future<Output = Called> + Send>>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more

Auto Trait Implementations§

§

impl<F> !RefUnwindSafe for Call<F>

§

impl<F> !UnwindSafe for Call<F>

§

impl<F> Freeze for Call<F>
where F: Freeze,

§

impl<F> Send for Call<F>

§

impl<F> Sync for Call<F>

§

impl<F> Unpin for Call<F>
where F: Unpin,

§

impl<F> UnsafeUnpin for Call<F>
where F: UnsafeUnpin,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.