pub struct RuntimeContext<'a, R> { /* private fields */ }
Expand description
Holds information specific to the deployed contract.
Implementations
sourceimpl<'a, R> RuntimeContext<'a, R> where
R: StateReader<Key, StoredValue>,
R::Error: Into<Error>,
impl<'a, R> RuntimeContext<'a, R> where
R: StateReader<Key, StoredValue>,
R::Error: Into<Error>,
sourcepub fn new(
tracking_copy: Rc<RefCell<TrackingCopy<R>>>,
entry_point_type: EntryPointType,
named_keys: &'a mut NamedKeys,
access_rights: ContextAccessRights,
runtime_args: RuntimeArgs,
authorization_keys: BTreeSet<AccountHash>,
account: &'a Account,
base_key: Key,
blocktime: BlockTime,
deploy_hash: DeployHash,
gas_limit: Gas,
gas_counter: Gas,
address_generator: Rc<RefCell<AddressGenerator>>,
protocol_version: ProtocolVersion,
correlation_id: CorrelationId,
phase: Phase,
engine_config: EngineConfig,
transfers: Vec<TransferAddr>,
remaining_spending_limit: U512
) -> Self
pub fn new(
tracking_copy: Rc<RefCell<TrackingCopy<R>>>,
entry_point_type: EntryPointType,
named_keys: &'a mut NamedKeys,
access_rights: ContextAccessRights,
runtime_args: RuntimeArgs,
authorization_keys: BTreeSet<AccountHash>,
account: &'a Account,
base_key: Key,
blocktime: BlockTime,
deploy_hash: DeployHash,
gas_limit: Gas,
gas_counter: Gas,
address_generator: Rc<RefCell<AddressGenerator>>,
protocol_version: ProtocolVersion,
correlation_id: CorrelationId,
phase: Phase,
engine_config: EngineConfig,
transfers: Vec<TransferAddr>,
remaining_spending_limit: U512
) -> Self
Creates new runtime context where we don’t already have one.
Where we already have a runtime context, consider using new_from_self()
.
sourcepub fn new_from_self(
&self,
base_key: Key,
entry_point_type: EntryPointType,
named_keys: &'a mut NamedKeys,
access_rights: ContextAccessRights,
runtime_args: RuntimeArgs
) -> Self
pub fn new_from_self(
&self,
base_key: Key,
entry_point_type: EntryPointType,
named_keys: &'a mut NamedKeys,
access_rights: ContextAccessRights,
runtime_args: RuntimeArgs
) -> Self
Creates new runtime context cloning values from self.
Returns all authorization keys for this deploy.
sourcepub fn named_keys_get(&self, name: &str) -> Option<&Key>
pub fn named_keys_get(&self, name: &str) -> Option<&Key>
Returns a named key by a name if it exists.
sourcepub fn named_keys(&self) -> &NamedKeys
pub fn named_keys(&self) -> &NamedKeys
Returns named keys.
sourcepub fn named_keys_mut(&mut self) -> &mut NamedKeys
pub fn named_keys_mut(&mut self) -> &mut NamedKeys
Returns a mutable reference to named keys.
sourcepub fn named_keys_contains_key(&self, name: &str) -> bool
pub fn named_keys_contains_key(&self, name: &str) -> bool
Checks if named keys contains a key referenced by name.
sourcepub fn remove_key(&mut self, name: &str) -> Result<(), Error>
pub fn remove_key(&mut self, name: &str) -> Result<(), Error>
Remove Key from the named_keys
map of the current context.
It removes both from the ephemeral map (RuntimeContext::named_keys) but
also persistable map (one that is found in the
TrackingCopy/GlobalState).
sourcepub fn get_caller(&self) -> AccountHash
pub fn get_caller(&self) -> AccountHash
Returns the caller of the contract.
sourcepub fn get_blocktime(&self) -> BlockTime
pub fn get_blocktime(&self) -> BlockTime
Returns the block time.
sourcepub fn get_deploy_hash(&self) -> DeployHash
pub fn get_deploy_hash(&self) -> DeployHash
Returns the deploy hash.
sourcepub fn access_rights_extend(&mut self, urefs: &[URef])
pub fn access_rights_extend(&mut self, urefs: &[URef])
Extends access rights with a new map.
sourcepub fn access_rights(&self) -> &ContextAccessRights
pub fn access_rights(&self) -> &ContextAccessRights
Returns a mapping of access rights for each URef
s address.
sourcepub fn args(&self) -> &RuntimeArgs
pub fn args(&self) -> &RuntimeArgs
Returns arguments.
sourcepub fn address_generator(&self) -> Rc<RefCell<AddressGenerator>>
pub fn address_generator(&self) -> Rc<RefCell<AddressGenerator>>
Returns new shared instance of an address generator.
sourcepub fn gas_counter(&self) -> Gas
pub fn gas_counter(&self) -> Gas
Returns the current gas counter.
sourcepub fn set_gas_counter(&mut self, new_gas_counter: Gas)
pub fn set_gas_counter(&mut self, new_gas_counter: Gas)
Sets the gas counter to a new value.
sourcepub fn base_key(&self) -> Key
pub fn base_key(&self) -> Key
Returns the base key.
This could be either a Key::Account
or a Key::Hash
depending on the entry point
type.
sourcepub fn protocol_version(&self) -> ProtocolVersion
pub fn protocol_version(&self) -> ProtocolVersion
Returns the protocol version.
sourcepub fn correlation_id(&self) -> CorrelationId
pub fn correlation_id(&self) -> CorrelationId
Returns the correlation id.
sourcepub fn new_hash_address(&mut self) -> Result<[u8; 32], Error>
pub fn new_hash_address(&mut self) -> Result<[u8; 32], Error>
Generates new deterministic hash for uses as an address.
sourcepub fn new_uref(&mut self, value: StoredValue) -> Result<URef, Error>
pub fn new_uref(&mut self, value: StoredValue) -> Result<URef, Error>
Creates new URef
instance.
sourcepub fn new_transfer_addr(&mut self) -> Result<TransferAddr, Error>
pub fn new_transfer_addr(&mut self) -> Result<TransferAddr, Error>
Creates a new transfer address using a transfer address generator.
sourcepub fn put_key(&mut self, name: String, key: Key) -> Result<(), Error>
pub fn put_key(&mut self, name: String, key: Key) -> Result<(), Error>
Puts key
to the map of named keys of current context.
sourcepub fn read_gs(&mut self, key: &Key) -> Result<Option<StoredValue>, Error>
pub fn read_gs(&mut self, key: &Key) -> Result<Option<StoredValue>, Error>
Read a stored value under a Key
.
sourcepub fn read_gs_direct(&mut self, key: &Key) -> Result<Option<StoredValue>, Error>
pub fn read_gs_direct(&mut self, key: &Key) -> Result<Option<StoredValue>, Error>
Reads a value from a global state directly.
Usage
DO NOT EXPOSE THIS VIA THE FFI - This function bypasses security checks and should be used with caution.
sourcepub fn read_gs_typed<T>(&mut self, key: &Key) -> Result<T, Error> where
T: TryFrom<StoredValue>,
T::Error: Debug,
pub fn read_gs_typed<T>(&mut self, key: &Key) -> Result<T, Error> where
T: TryFrom<StoredValue>,
T::Error: Debug,
This method is a wrapper over read_gs
in the sense that it extracts the type held by a
StoredValue
stored in the global state in a type safe manner.
This is useful if you want to get the exact type from global state.
sourcepub fn get_keys(&mut self, key_tag: &KeyTag) -> Result<BTreeSet<Key>, Error>
pub fn get_keys(&mut self, key_tag: &KeyTag) -> Result<BTreeSet<Key>, Error>
Returns all keys based on the tag prefix.
sourcepub fn read_account(&mut self, key: &Key) -> Result<Option<StoredValue>, Error>
pub fn read_account(&mut self, key: &Key) -> Result<Option<StoredValue>, Error>
Read an account from the global state.
sourcepub fn write_account(&mut self, key: Key, account: Account) -> Result<(), Error>
pub fn write_account(&mut self, key: Key, account: Account) -> Result<(), Error>
Write an account to the global state.
sourcepub fn write_transfer(&mut self, key: Key, value: Transfer)
pub fn write_transfer(&mut self, key: Key, value: Transfer)
Write a transfer instance to the global state.
sourcepub fn write_era_info(&mut self, key: Key, value: EraInfo)
pub fn write_era_info(&mut self, key: Key, value: EraInfo)
Write an era info instance to the global state.
sourcepub fn grant_access(&mut self, uref: URef) -> GrantedAccess
pub fn grant_access(&mut self, uref: URef) -> GrantedAccess
Grants access to a URef
; unless access was pre-existing.
sourcepub fn remove_access(&mut self, uref_addr: URefAddr, access_rights: AccessRights)
pub fn remove_access(&mut self, uref_addr: URefAddr, access_rights: AccessRights)
Removes an access right from the current runtime context.
sourcepub fn effect(&self) -> ExecutionEffect
pub fn effect(&self) -> ExecutionEffect
Returns current effects of a tracking copy.
sourcepub fn execution_journal(&self) -> ExecutionJournal
pub fn execution_journal(&self) -> ExecutionJournal
Returns an ExecutionJournal
.
sourcepub fn transfers(&self) -> &Vec<TransferAddr>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn transfers(&self) -> &Vec<TransferAddr>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns list of transfers.
sourcepub fn transfers_mut(&mut self) -> &mut Vec<TransferAddr>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn transfers_mut(&mut self) -> &mut Vec<TransferAddr>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns mutable list of transfers.
sourcepub fn is_readable(&self, key: &Key) -> bool
pub fn is_readable(&self, key: &Key) -> bool
Tests whether reading from the key
is valid.
sourcepub fn is_addable(&self, key: &Key) -> bool
pub fn is_addable(&self, key: &Key) -> bool
Tests whether addition to key
is valid.
sourcepub fn is_writeable(&self, key: &Key) -> bool
pub fn is_writeable(&self, key: &Key) -> bool
Tests whether writing to key
is valid.
sourcepub fn get_main_purse(&mut self) -> Result<URef, Error>
pub fn get_main_purse(&mut self) -> Result<URef, Error>
Gets main purse id
sourcepub fn entry_point_type(&self) -> EntryPointType
pub fn entry_point_type(&self) -> EntryPointType
Gets entry point type.
sourcepub fn dictionary_put(
&mut self,
seed_uref: URef,
dictionary_item_key: &str,
cl_value: CLValue
) -> Result<(), Error>
pub fn dictionary_put(
&mut self,
seed_uref: URef,
dictionary_item_key: &str,
cl_value: CLValue
) -> Result<(), Error>
Puts a dictionary item key from a dictionary referenced by a uref
.
sourcepub fn system_contract_registry(&self) -> Result<SystemContractRegistry, Error>
pub fn system_contract_registry(&self) -> Result<SystemContractRegistry, Error>
Returns system contract registry by querying the global state.
Auto Trait Implementations
impl<'a, R> !RefUnwindSafe for RuntimeContext<'a, R>
impl<'a, R> !Send for RuntimeContext<'a, R>
impl<'a, R> !Sync for RuntimeContext<'a, R>
impl<'a, R> Unpin for RuntimeContext<'a, R>
impl<'a, R> !UnwindSafe for RuntimeContext<'a, R>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self
to use its Binary
implementation when Debug
-formatted.
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Causes self
to use its Octal
implementation when Debug
-formatted.
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
fn pipe_as_mut<'a, T, R>(&'a mut self, func: impl FnOnce(&'a mut T) -> R) -> R where
Self: AsMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
T: 'a,
R: 'a,
Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
T: 'a,
R: 'a,
Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more
impl<T> PipeDeref for T
impl<T> PipeDeref for T
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
fn pipe_deref<'a, R>(&'a self, func: impl FnOnce(&'a Self::Target) -> R) -> R where
Self: Deref,
R: 'a,
Pipes a dereference into a function that cannot normally be called in suffix position. Read more
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more
impl<T> PipeRef for T
impl<T> PipeRef for T
impl<T> Tap for T
impl<T> Tap for T
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Provides immutable access for inspection. Read more
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
Calls tap
in debug builds, and does nothing in release builds.
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Provides mutable access for modification. Read more
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
Calls tap_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the reference for inspection.
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Calls tap_ref
in debug builds, and does nothing in release builds.
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the reference for modification.
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_ref_mut
in debug builds, and does nothing in release builds.
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Provides immutable access to the borrow for inspection. Read more
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Calls tap_borrow
in debug builds, and does nothing in release builds.
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Provides mutable access to the borrow for modification.
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Calls tap_borrow_mut
in debug builds, and does nothing in release
builds. Read more
impl<T> TapDeref for T
impl<T> TapDeref for T
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Immutably dereferences self
for inspection.
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Calls tap_deref
in debug builds, and does nothing in release builds.
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Mutably dereferences self
for modification.
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Calls tap_deref_mut
in debug builds, and does nothing in release
builds. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more