pub struct CaptureSet { /* private fields */ }Expand description
Which capturable aspects a capture should collect.
There is no Default implementation; see the module documentation.
Implementations§
Source§impl CaptureSet
impl CaptureSet
Sourcepub const NONE: Self
pub const NONE: Self
Collect nothing.
Every aspect is then Captured::NotCaptured,
which leaves the target thread’s own values alone.
Sourcepub const IMPERSONATION: Self
pub const IMPERSONATION: Self
Just the impersonation context.
Sourcepub const ERROR_MODE: Self
pub const ERROR_MODE: Self
Just the thread error mode.
Sourcepub const TRANSACTION: Self
pub const TRANSACTION: Self
Just the current TxF transaction.
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The recommended starting point: impersonation and the thread error mode.
Adding an aspect to this set is a breaking change, and that is the
reason it exists as a name rather than as a Default implementation.
TxF is deliberately excluded. It is deprecated by Microsoft, capturing it
costs a lazy ntdll binding a caller may never need, and – the reason
that actually decides it – a captured transaction enlists remoted work
in a transaction the caller may commit or roll back while that work is
still running. That is a hazard to opt into deliberately, not one to
acquire by taking a default. Add TRANSACTION when
you mean it.
Sourcepub const ALL: Self
pub const ALL: Self
Every capturable aspect this version knows.
This set grows. Membership is its meaning, so a later version adding an aspect will capture it here without further notice. A caller that needs a fixed set should name its aspects instead.
Sourcepub fn aspects(self) -> impl Iterator<Item = CapturableAspect>
pub fn aspects(self) -> impl Iterator<Item = CapturableAspect>
The aspects in this set, in a stable order.
Trait Implementations§
Source§impl Clone for CaptureSet
impl Clone for CaptureSet
Source§fn clone(&self) -> CaptureSet
fn clone(&self) -> CaptureSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more