pub struct MultiContextBuilder { /* private fields */ }
Expand description

Contains methods for building a multi-context.

Use this builder if you need to construct a context that has multiple kinds, each representing their own Context. Otherwise, use ContextBuilder.

Obtain an instance of the builder by calling MultiContextBuilder::new; then, call MultiContextBuilder::add_context to add a kind. MultiContextBuilder setters return a reference the same builder, so they can be chained together.

Implementations§

Create a new multi-context builder. An empty builder cannot create a valid Context; you must add one or more kinds via MultiContextBuilder::add_context.

If you already have a list of contexts, you can instead use MultiContextBuilder::of.

Create a new multi-context builder from the given list of contexts.

Adds a context to the builder.

It is invalid to add more than one context of the same Kind. This error is detected when you call MultiContextBuilder::build.

If context is a multi-context, this is equivalent to adding each individual context.

Creates a context from the builder’s current properties.

The context is immutable and will not be affected by any subsequent actions on the MultiContextBuilder.

It is possible for a MultiContextBuilder to represent an invalid state. In those situations, an Err type will be returned.

If only one context was added to the builder, this method returns that context.

Trait Implementations§

Creates an empty multi-context builder. In this state, a context must be added in order to build successfully.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more