pub struct TaskApplication { /* private fields */ }Expand description
The POST /v1/tasks Application — resolves a BlueprintRef and
runs it to completion through TaskLaunchService.
Implementations§
Source§impl TaskApplication
impl TaskApplication
Sourcepub fn new(
launch: Arc<TaskLaunchService>,
store: Arc<dyn BlueprintStore>,
) -> Self
pub fn new( launch: Arc<TaskLaunchService>, store: Arc<dyn BlueprintStore>, ) -> Self
Build a TaskApplication that can resolve both Inline and
Id BlueprintRefs (the Id path reads through store).
Sourcepub fn new_inline_only(launch: Arc<TaskLaunchService>) -> Self
pub fn new_inline_only(launch: Arc<TaskLaunchService>) -> Self
Build a TaskApplication restricted to Inline BlueprintRefs
— no store is configured, so Id resolution always fails with
TaskApplicationError::NoStore.
Sourcepub async fn resolve(
&self,
bp_ref: &BlueprintRef,
) -> Result<(Blueprint, Option<BlueprintVersion>), TaskApplicationError>
pub async fn resolve( &self, bp_ref: &BlueprintRef, ) -> Result<(Blueprint, Option<BlueprintVersion>), TaskApplicationError>
Resolve a BlueprintRef and return the real Blueprint plus,
when it went through the store, the resolved version.
Trait Implementations§
Source§impl Application for TaskApplication
impl Application for TaskApplication
Source§fn handle<'life0, 'async_trait>(
&'life0 self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle<'life0, 'async_trait>(
&'life0 self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resolve the BlueprintRef (Inline / Id) and run the flow to
completion through TaskLaunchService::launch.
Source§type Input = TaskApplicationInput
type Input = TaskApplicationInput
The request type this Application accepts.
Source§type Output = TaskApplicationOutput
type Output = TaskApplicationOutput
The result type returned on success.
Source§type Error = TaskApplicationError
type Error = TaskApplicationError
The error type returned on failure.
Auto Trait Implementations§
impl !RefUnwindSafe for TaskApplication
impl !UnwindSafe for TaskApplication
impl Freeze for TaskApplication
impl Send for TaskApplication
impl Sync for TaskApplication
impl Unpin for TaskApplication
impl UnsafeUnpin for TaskApplication
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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