pub struct ServiceContext<R: Runtime> {
pub notifier: Notifier<R>,
pub app: AppHandle<R>,
pub shutdown: CancellationToken,
}Expand description
Passed into both init and run.
Gives your service everything it needs to interact with the outside world.
Fields§
§notifier: Notifier<R>Fire a local notification. Works on all platforms.
app: AppHandle<R>Emit an event to the JS UI layer.
shutdown: CancellationTokenCancelled when stopService() is called.
Auto Trait Implementations§
impl<R> Freeze for ServiceContext<R>
impl<R> !RefUnwindSafe for ServiceContext<R>
impl<R> Send for ServiceContext<R>
impl<R> Sync for ServiceContext<R>
impl<R> Unpin for ServiceContext<R>
impl<R> UnsafeUnpin for ServiceContext<R>
impl<R> !UnwindSafe for ServiceContext<R>
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