Trait product_os_capabilities::Service
source · pub trait Service: Send + Sync + Any {
Show 15 methods
// Required methods
fn register<'life0, 'async_trait>(
&'life0 self,
service: Arc<dyn Service>,
) -> Pin<Box<dyn Future<Output = RegistryService> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn register_mut<'life0, 'async_trait>(
&'life0 self,
service: Arc<Mutex<dyn Service>>,
) -> Pin<Box<dyn Future<Output = RegistryService> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn identifier(&self) -> String;
fn key(&self) -> String;
fn is_enabled(&self) -> bool;
fn is_active(&self) -> bool;
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn restart<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn start_mut<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop_mut<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn restart_mut<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn init_service<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn init_service_mut<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}
Required Methods§
fn register<'life0, 'async_trait>(
&'life0 self,
service: Arc<dyn Service>,
) -> Pin<Box<dyn Future<Output = RegistryService> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_mut<'life0, 'async_trait>(
&'life0 self,
service: Arc<Mutex<dyn Service>>,
) -> Pin<Box<dyn Future<Output = RegistryService> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn identifier(&self) -> String
fn key(&self) -> String
fn is_enabled(&self) -> bool
fn is_active(&self) -> bool
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn restart<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start_mut<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop_mut<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn restart_mut<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Provided Methods§
fn init_service<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn init_service_mut<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Implementations§
source§impl dyn Service
impl dyn Service
sourcepub fn downcast_ref<T: Service>(&self) -> Option<&T>
pub fn downcast_ref<T: Service>(&self) -> Option<&T>
Returns some reference to the boxed value if it is of type T
, or
None
if it isn’t.
sourcepub unsafe fn downcast_ref_unchecked<T: Service>(&self) -> &T
pub unsafe fn downcast_ref_unchecked<T: Service>(&self) -> &T
Returns a reference to the boxed value, blindly assuming it to be of type T
.
If you are not absolutely certain of T
, you must not call this.
sourcepub fn downcast_mut<T: Service>(&mut self) -> Option<&mut T>
pub fn downcast_mut<T: Service>(&mut self) -> Option<&mut T>
Returns some mutable reference to the boxed value if it is of type T
, or
None
if it isn’t.
sourcepub unsafe fn downcast_mut_unchecked<T: Service>(&mut self) -> &mut T
pub unsafe fn downcast_mut_unchecked<T: Service>(&mut self) -> &mut T
Returns a mutable reference to the boxed value, blindly assuming it to be of type T
.
If you are not absolutely certain of T
, you must not call this.
source§impl dyn Service
impl dyn Service
sourcepub fn downcast<T: Service>(self: Box<Self>) -> Result<Box<T>, Box<Self>>
pub fn downcast<T: Service>(self: Box<Self>) -> Result<Box<T>, Box<Self>>
Returns the boxed value if it is of type T
, or Err(Self)
if it isn’t.
sourcepub unsafe fn downcast_unchecked<T: Service>(self: Box<Self>) -> Box<T>
pub unsafe fn downcast_unchecked<T: Service>(self: Box<Self>) -> Box<T>
Returns the boxed value, blindly assuming it to be of type T
.
If you are not absolutely certain of T
, you must not call this.