pub struct ServiceConventions { /* private fields */ }
Expand description
Convention-based service discovery
Implementations§
Source§impl ServiceConventions
impl ServiceConventions
Sourcepub fn add_naming_convention(
&mut self,
pattern: &str,
lifetime: ServiceScope,
) -> &mut Self
pub fn add_naming_convention( &mut self, pattern: &str, lifetime: ServiceScope, ) -> &mut Self
Add a naming convention
Sourcepub fn add_interface_pattern(&mut self, pattern: &str) -> &mut Self
pub fn add_interface_pattern(&mut self, pattern: &str) -> &mut Self
Add an interface naming pattern
Sourcepub fn add_scan_path(&mut self, path: &str) -> &mut Self
pub fn add_scan_path(&mut self, path: &str) -> &mut Self
Add a scan path
Sourcepub fn add_custom_rule<R: ConventionRule + 'static>(
&mut self,
rule: R,
) -> &mut Self
pub fn add_custom_rule<R: ConventionRule + 'static>( &mut self, rule: R, ) -> &mut Self
Add a custom convention rule
Sourcepub fn get_lifetime_for_type(&self, type_name: &str) -> ServiceLifetime
pub fn get_lifetime_for_type(&self, type_name: &str) -> ServiceLifetime
Get lifetime for a service type name
Sourcepub fn is_interface(&self, type_name: &str) -> bool
pub fn is_interface(&self, type_name: &str) -> bool
Check if a type name is an interface
Sourcepub fn find_implementation_for_interface(
&self,
interface_name: &str,
) -> Option<String>
pub fn find_implementation_for_interface( &self, interface_name: &str, ) -> Option<String>
Find implementation for an interface by convention
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ServiceConventions
impl !RefUnwindSafe for ServiceConventions
impl Send for ServiceConventions
impl Sync for ServiceConventions
impl Unpin for ServiceConventions
impl !UnwindSafe for ServiceConventions
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