pub struct Context { /* private fields */ }
Implementations§
Source§impl Context
impl Context
pub fn new() -> Context
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: Box<dyn Clock>)
pub fn set_static_time(&mut self, time: DateTime<Utc>)
pub fn configuration<T>(
&self,
key: T,
) -> Result<<T as DynConfigurationKey>::Value, ServiceError>where
T: DynConfigurationKey,
pub fn set_configuration(&mut self, configuration: Configuration)
pub fn override_configuration<T>(
&mut self,
key: T,
value: <T as DynConfigurationKey>::Value,
) -> Result<(), OverrideConfigurationError>where
T: DynConfigurationKey,
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 Freeze for Context
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