pub struct BaseModule { /* private fields */ }
Expand description
Base module implementation for common functionality
Implementations§
Source§impl BaseModule
impl BaseModule
Sourcepub fn new(name: &'static str) -> BaseModule
pub fn new(name: &'static str) -> BaseModule
Create a new base module
Sourcepub fn with_version(self, version: &'static str) -> BaseModule
pub fn with_version(self, version: &'static str) -> BaseModule
Set module version
Sourcepub fn with_description(self, description: &'static str) -> BaseModule
pub fn with_description(self, description: &'static str) -> BaseModule
Set module description
Sourcepub fn with_dependencies(self, dependencies: Vec<&'static str>) -> BaseModule
pub fn with_dependencies(self, dependencies: Vec<&'static str>) -> BaseModule
Set module dependencies
Sourcepub fn with_optional(self, is_optional: bool) -> BaseModule
pub fn with_optional(self, is_optional: bool) -> BaseModule
Set if module is optional
Trait Implementations§
Source§impl Debug for BaseModule
impl Debug for BaseModule
Source§impl Module for BaseModule
impl Module for BaseModule
Source§fn configure(
&self,
builder: ContainerBuilder,
) -> Result<ContainerBuilder, ModuleError>
fn configure( &self, builder: ContainerBuilder, ) -> Result<ContainerBuilder, ModuleError>
Configure services in the container builder
Source§fn dependencies(&self) -> Vec<&'static str>
fn dependencies(&self) -> Vec<&'static str>
Module dependencies (other modules that must be loaded first)
Source§fn description(&self) -> Option<&'static str>
fn description(&self) -> Option<&'static str>
Module description
Source§fn is_optional(&self) -> bool
fn is_optional(&self) -> bool
Check if this module can be disabled
Source§fn routes(&self) -> Vec<RouteDefinition>
fn routes(&self) -> Vec<RouteDefinition>
Define routes for this module
Source§fn middleware(&self) -> Vec<MiddlewareDefinition>
fn middleware(&self) -> Vec<MiddlewareDefinition>
Define middleware for this module
Auto Trait Implementations§
impl Freeze for BaseModule
impl RefUnwindSafe for BaseModule
impl Send for BaseModule
impl Sync for BaseModule
impl Unpin for BaseModule
impl UnwindSafe for BaseModule
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> 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