pub struct ModuleBuilder<M: Module> { /* private fields */ }Expand description
Builds a Module. Component parameters can be set, and both components
and providers implementations can be overridden.
Implementations§
Source§impl<M: Module> ModuleBuilder<M>
impl<M: Module> ModuleBuilder<M>
Sourcepub fn with_submodules(submodules: M::Submodules) -> Self
pub fn with_submodules(submodules: M::Submodules) -> Self
Create a ModuleBuilder by providing the module’s submodules.
Sourcepub fn with_component_parameters<C: Component<M>>(
self,
params: C::Parameters,
) -> Selfwhere
M: HasComponent<C::Interface>,
pub fn with_component_parameters<C: Component<M>>(
self,
params: C::Parameters,
) -> Selfwhere
M: HasComponent<C::Interface>,
Set the parameters of the specified component. If the parameters are not manually set, the defaults will be used.
Sourcepub fn with_component_override<I: Interface + ?Sized>(
self,
component: Box<I>,
) -> Selfwhere
M: HasComponent<I>,
pub fn with_component_override<I: Interface + ?Sized>(
self,
component: Box<I>,
) -> Selfwhere
M: HasComponent<I>,
Override a component implementation. This method is best used when the overriding component has no injected dependencies.
Sourcepub fn with_component_override_fn<I: Interface + ?Sized>(
self,
component_fn: ComponentFn<M, I>,
) -> Selfwhere
M: HasComponent<I>,
pub fn with_component_override_fn<I: Interface + ?Sized>(
self,
component_fn: ComponentFn<M, I>,
) -> Selfwhere
M: HasComponent<I>,
Override a component implementation. This method is best used when the overriding component has injected dependencies.
Auto Trait Implementations§
impl<M> Freeze for ModuleBuilder<M>
impl<M> !RefUnwindSafe for ModuleBuilder<M>
impl<M> !Send for ModuleBuilder<M>
impl<M> !Sync for ModuleBuilder<M>
impl<M> Unpin for ModuleBuilder<M>
impl<M> !UnwindSafe for ModuleBuilder<M>
Blanket Implementations§
Source§impl<Data> ApiSuccessResponse for Data
impl<Data> ApiSuccessResponse for Data
fn api_response<Meta>(self, meta: Option<Meta>) -> ApiResponse<Self, Meta>
fn api_response_without_meta<Meta>(self) -> ApiResponse<Self, Meta>
fn api_response_with_meta<Meta>(self, meta: Meta) -> ApiResponse<Self, Meta>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> FutureTraceExt for Twhere
T: FutureExt,
impl<T> FutureTraceExt for Twhere
T: FutureExt,
Source§fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
Pass the span of opentelemetry to the current context of tracing.
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request