Struct shiny_common::context::Context
source · pub struct Context { /* private fields */ }Implementations§
source§impl Context
impl Context
pub fn new() -> Self
pub fn set_cancellation_token(&mut self, cancellation_token: CancellationToken)
pub fn is_cancelled(&self) -> bool
pub fn now(&self) -> DateTime<Utc>
pub fn set_clock(&mut self, clock: impl Clock + 'static)
pub fn set_static_time(&mut self, time: DateTime<Utc>)
pub fn configuration<T: DynConfigurationKey>( &self, key: T ) -> Result<T::Value, ServiceError>
pub fn set_configuration(&mut self, configuration: Configuration)
pub fn override_configuration<T: DynConfigurationKey>( &mut self, key: T, value: impl Into<T::Value> ) -> Result<(), OverrideConfigurationError>
pub fn internal_error(&self, code: impl Into<Cow<'static, str>>) -> ServiceError
pub fn dependency_error( &self, dependency_name: impl Into<Cow<'static, str>>, code: impl Into<Cow<'static, str>> ) -> ServiceError
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
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