Skip to main content

Submit

Struct Submit 

Source
pub struct Submit<'a, Watch = Unwatched, Admission = Waiting> { /* private fields */ }
Available on crate feature controller only.
Expand description

An explicit single-use controller submission operation.

Configure final-outcome delivery and an optional ownership-admission deadline. Finish with execute or try_intake. The default waiting, unwatched operation can also be awaited directly. APIs that accept a Future require execute() or IntoFuture::into_future. Every terminal method consumes the operation, including when intake returns an error.

Watch and Admission are operation type states. watch and ownership_timeout select them. Applications do not need to name them.

Implementations§

Source§

impl<'a, Admission> Submit<'a, Unwatched, Admission>

Source

pub fn watch(self) -> Submit<'a, Watched, Admission>

Final-outcome delivery through TaskWaiter.

Successful intake returns only TaskWaiter. Its TaskWaiter::id is the submission identity. The waiter later reports controller rejection or the admitted task’s final outcome.

Source§

impl<'a, Watch> Submit<'a, Watch, Waiting>

Source

pub fn ownership_timeout( self, wait_for: Duration, ) -> Submit<'a, Watch, OwnershipTimed>

Cleanup-ownership admission deadline.

The deadline stops after ownership succeeds. execute can then wait without a deadline for controller command capacity. An immediately available permit can succeed when wait_for is Duration::ZERO. A timeout sends no command and publishes no lifecycle event.

Source§

impl Submit<'_, Unwatched, Waiting>

Source

pub async fn execute(self) -> Result<TaskId, ControllerError>

Waiting controller command intake with an unwatched TaskId result.

Ok(id) confirms only command intake. Slot admission and runtime registration happen later. Awaiting the default operation directly is equivalent to calling this method. A successful PreparedSubmission cannot produce NotConfigured.

§Errors
Source

pub fn try_intake(self) -> Result<TaskId, ControllerError>

Fail-fast controller command intake with an unwatched TaskId result.

Ok(id) has the same intake-only meaning as execute. A successful PreparedSubmission cannot produce NotConfigured.

§Errors
Source§

impl Submit<'_, Unwatched, OwnershipTimed>

Source

pub async fn execute(self) -> Result<TaskId, ControllerError>

Ownership-bounded admission followed by normal command-queue backpressure.

A successful PreparedSubmission cannot produce NotConfigured.

§Errors
Source§

impl Submit<'_, Watched, Waiting>

Source

pub async fn execute(self) -> Result<TaskWaiter, ControllerError>

Waiting controller command intake with a final-outcome waiter.

Success confirms only controller command intake. TaskWaiter::id is the submission identity. TaskWaiter::wait reports rejection or the admitted task’s final outcome. A successful PreparedSubmission cannot produce NotConfigured.

§Errors
Source

pub fn try_intake(self) -> Result<TaskWaiter, ControllerError>

Fail-fast controller command intake with a final-outcome waiter.

A successful PreparedSubmission cannot produce NotConfigured.

§Errors
Source§

impl Submit<'_, Watched, OwnershipTimed>

Source

pub async fn execute(self) -> Result<TaskWaiter, ControllerError>

Ownership-bounded admission with a final-outcome waiter after command intake.

A successful PreparedSubmission cannot produce NotConfigured.

§Errors

Trait Implementations§

Source§

impl<Watch, Admission> Debug for Submit<'_, Watch, Admission>

Source§

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

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

impl<'a> IntoFuture for Submit<'a, Unwatched, Waiting>

Source§

type Output = Result<TaskId, ControllerError>

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

type IntoFuture = Pin<Box<dyn Future<Output = <Submit<'a> as IntoFuture>::Output> + Send + 'a>>

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<'a, Watch = Unwatched, Admission = Waiting> !RefUnwindSafe for Submit<'a, Watch, Admission>

§

impl<'a, Watch = Unwatched, Admission = Waiting> !UnwindSafe for Submit<'a, Watch, Admission>

§

impl<'a, Watch, Admission> Freeze for Submit<'a, Watch, Admission>
where Watch: Freeze, Admission: Freeze,

§

impl<'a, Watch, Admission> Send for Submit<'a, Watch, Admission>
where Watch: Send, Admission: Send,

§

impl<'a, Watch, Admission> Sync for Submit<'a, Watch, Admission>
where Watch: Sync, Admission: Sync,

§

impl<'a, Watch, Admission> Unpin for Submit<'a, Watch, Admission>
where Watch: Unpin, Admission: Unpin,

§

impl<'a, Watch, Admission> UnsafeUnpin for Submit<'a, Watch, Admission>
where Watch: UnsafeUnpin, Admission: 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> 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, 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, <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