pub struct Scope { /* private fields */ }
Implementations§
Source§impl Scope
impl Scope
pub fn addr(&self) -> Addr
👎Deprecated: use
actor()
insteadpub fn actor(&self) -> Addr
pub fn group(&self) -> Addr
Sourcepub fn set_trace_id(&self, trace_id: TraceId)
pub fn set_trace_id(&self, trace_id: TraceId)
Replaces the current trace id with the provided one.
Sourcepub fn permissions(&self) -> Permissions
pub fn permissions(&self) -> Permissions
Returns the current permissions (for logging, telemetry and so on).
Sourcepub async fn within<F: Future>(self, f: F) -> F::Output
pub async fn within<F: Future>(self, f: F) -> F::Output
Wraps the provided future with the current scope.
Sourcepub fn sync_within<R>(self, f: impl FnOnce() -> R) -> R
pub fn sync_within<R>(self, f: impl FnOnce() -> R) -> R
Runs the provided function with the current scope.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Scope
impl !RefUnwindSafe for Scope
impl Send for Scope
impl !Sync for Scope
impl Unpin for Scope
impl !UnwindSafe for Scope
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