Node

Struct Node 

Source
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>
where Head: ApplicationPart + Send + Sync, Tail: ApplicationPart + Send + Sync,

Source§

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>

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>

Called before application startup for this part. Read more
Source§

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>

Called before application shutdown for this part. Read more
Source§

impl<Head, Tail> ApplicationPartBuilder for Node<Head, Tail>

Source§

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>

Builds an application part instance using the provided service provider. Read more
Source§

impl<Head, Tail, HeadIndex> Chain<InHead<HeadIndex>> for Node<Head, Tail>
where HeadIndex: Index, Head: Chain<HeadIndex>,

Source§

type Element = <Head as Chain<HeadIndex>>::Element

The type of the element at the specified index.
Source§

fn get(&self) -> &Self::Element

Retrieves an immutable reference to the element at the specified index. Read more
Source§

fn get_mut(&mut self) -> &mut Self::Element

Retrieves a mutable reference to the element at the specified index. Read more
Source§

impl<Head, Tail, TailIndex> Chain<InTail<TailIndex>> for Node<Head, Tail>
where TailIndex: Index, Tail: Chain<TailIndex>,

Source§

type Element = <Tail as Chain<TailIndex>>::Element

The type of the element at the specified index.
Source§

fn get(&self) -> &Self::Element

Retrieves an immutable reference to the element at the specified index. Read more
Source§

fn get_mut(&mut self) -> &mut Self::Element

Retrieves a mutable reference to the element at the specified index. Read more

Auto Trait Implementations§

§

impl<Head, Tail> Freeze for Node<Head, Tail>
where Head: Freeze, Tail: Freeze,

§

impl<Head, Tail> RefUnwindSafe for Node<Head, Tail>
where Head: RefUnwindSafe, Tail: RefUnwindSafe,

§

impl<Head, Tail> Send for Node<Head, Tail>
where Head: Send, Tail: Send,

§

impl<Head, Tail> Sync for Node<Head, Tail>
where Head: Sync, Tail: Sync,

§

impl<Head, Tail> Unpin for Node<Head, Tail>
where Head: Unpin, Tail: Unpin,

§

impl<Head, Tail> UnwindSafe for Node<Head, Tail>
where Head: UnwindSafe, Tail: UnwindSafe,

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> Chain<Here> for T

Source§

fn get(&self) -> &T

Retrieves an immutable reference to the current element.

§Returns

A reference to the current element of type T.

Source§

fn get_mut(&mut self) -> &mut T

Retrieves a mutable reference to the current element.

§Returns

A mutable reference to the current element of type T.

Source§

type Element = T

The type of the element at the specified index.
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> IntoEither for T

Source§

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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