pub struct Node<Head, Tail> { /* private fields */ }Expand description
A composite application part that combines two other application parts, Head and Tail.
The Node struct allows you to chain two application parts together, enabling them to
work as a single unit. Each part must implement the ApplicationPart trait, and the
Node struct itself implements ApplicationPart, delegating its behavior to the
Head and Tail components.
§Type Parameters
Head: The first application part in the chain.Tail: The second application part in the chain.
Trait Implementations§
Source§impl<Head, Tail> ApplicationPart for Node<Head, Tail>
impl<Head, Tail> ApplicationPart for Node<Head, Tail>
Source§type Error = Either<<Head as ApplicationPart>::Error, <Tail as ApplicationPart>::Error>
type Error = Either<<Head as ApplicationPart>::Error, <Tail as ApplicationPart>::Error>
The error type returned by this application part’s hooks.
Source§fn name() -> Cow<'static, str>
fn name() -> Cow<'static, str>
Returns the name of this application part as a string. Read more
Source§async fn before_startup(
&mut self,
cancellation_token: CancellationToken,
) -> Result<(), Self::Error>
async fn before_startup( &mut self, cancellation_token: CancellationToken, ) -> Result<(), Self::Error>
Called before application startup for this part. Read more
Source§async fn run(
&mut self,
cancellation_token: CancellationToken,
) -> Result<(), Self::Error>
async fn run( &mut self, cancellation_token: CancellationToken, ) -> Result<(), Self::Error>
Runs the main logic for this application part. Read more
Source§async fn before_shutdown(
&mut self,
cancellation_token: CancellationToken,
) -> Result<(), Self::Error>
async fn before_shutdown( &mut self, cancellation_token: CancellationToken, ) -> Result<(), Self::Error>
Called before application shutdown for this part. Read more
Source§impl<Head, Tail> ApplicationPartBuilder for Node<Head, Tail>where
Head: ApplicationPartBuilder,
Tail: ApplicationPartBuilder,
impl<Head, Tail> ApplicationPartBuilder for Node<Head, Tail>where
Head: ApplicationPartBuilder,
Tail: ApplicationPartBuilder,
Source§type ApplicationPart = Node<WithInstrumentation<<Head as ApplicationPartBuilder>::ApplicationPart>, <Tail as ApplicationPartBuilder>::ApplicationPart>
type ApplicationPart = Node<WithInstrumentation<<Head as ApplicationPartBuilder>::ApplicationPart>, <Tail as ApplicationPartBuilder>::ApplicationPart>
The type of application part produced by this builder. Read more
Source§fn build(
self,
service_provider: ServiceProvider,
) -> ConstructionResult<Self::ApplicationPart>
fn build( self, service_provider: ServiceProvider, ) -> ConstructionResult<Self::ApplicationPart>
Builds an application part instance using the provided service provider. Read more
Source§impl<Head, Tail, HeadIndex> Chain<InHead<HeadIndex>> for Node<Head, Tail>
impl<Head, Tail, HeadIndex> Chain<InHead<HeadIndex>> for Node<Head, Tail>
Source§impl<Head, Tail, TailIndex> Chain<InTail<TailIndex>> for Node<Head, Tail>
impl<Head, Tail, TailIndex> Chain<InTail<TailIndex>> for Node<Head, Tail>
Auto Trait Implementations§
impl<Head, Tail> Freeze for Node<Head, Tail>
impl<Head, Tail> RefUnwindSafe for Node<Head, Tail>where
Head: RefUnwindSafe,
Tail: RefUnwindSafe,
impl<Head, Tail> Send for Node<Head, Tail>
impl<Head, Tail> Sync for Node<Head, Tail>
impl<Head, Tail> Unpin for Node<Head, Tail>
impl<Head, Tail> UnwindSafe for Node<Head, Tail>where
Head: UnwindSafe,
Tail: UnwindSafe,
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
Source§impl<T> Chain<Here> for T
impl<T> Chain<Here> for T
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