pub struct ServiceData {
pub name: String,
pub id: NodeId,
pub status: ServiceStatus,
/* private fields */
}Expand description
The inner Service data structure. Stored globally in the GraphDataCache. Accessed through the Service trait.
Fields§
§name: String§id: NodeId§status: ServiceStatusImplementations§
Source§impl ServiceData
impl ServiceData
Sourcepub fn deps(&self) -> &[NodeId]
pub fn deps(&self) -> &[NodeId]
Gets this service’s dependencies as NodeIds. Use the GraphDataCache to get the particular dependencies.
Sourcepub fn status(&self) -> ServiceStatus
pub fn status(&self) -> ServiceStatus
Gets this service’s status, owned.
Sourcepub fn registered(&self) -> bool
pub fn registered(&self) -> bool
Returns whether ServiceAppExt::register_service was called for this service’s Service resource.
Sourcepub fn spin_up(&mut self, world: &mut World)
pub fn spin_up(&mut self, world: &mut World)
Spins the service up, automatically running its initialization and on_up hooks. Will do nothing if the service is already up. See hooks for more details.
Sourcepub fn restart(&mut self, world: &mut World)
pub fn restart(&mut self, world: &mut World)
Forcibly spins the service up, automatically running its initialization and on_up hooks. See hooks for more details.
Sourcepub fn spin_down(&mut self, world: &mut World)
pub fn spin_down(&mut self, world: &mut World)
Spins the service down, automatically running its deinitialization and on_down hooks. Will do nothing if the service is already down for any reason. See hooks for more details.
Sourcepub fn fail(&mut self, world: &mut World, error: ServiceError)
pub fn fail(&mut self, world: &mut World, error: ServiceError)
Fails the service with the given error. Will run the deinitialization and on_down hooks. If the deinit hook fails during this process, the service will forcibly shut down.
Trait Implementations§
Source§impl Clone for ServiceData
impl Clone for ServiceData
Source§fn clone(&self) -> ServiceData
fn clone(&self) -> ServiceData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServiceData
impl Debug for ServiceData
Source§impl Hash for ServiceData
impl Hash for ServiceData
Source§impl PartialEq for ServiceData
impl PartialEq for ServiceData
impl Eq for ServiceData
impl StructuralPartialEq for ServiceData
Auto Trait Implementations§
impl Freeze for ServiceData
impl RefUnwindSafe for ServiceData
impl Send for ServiceData
impl Sync for ServiceData
impl Unpin for ServiceData
impl UnwindSafe for ServiceData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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