pub struct AdapterContext { /* private fields */ }Expand description
A caller-supplied witness and logical operation identity.
Clone this context for retries of the same operation. Create a new context with a distinct identity for a different call, including identical parallel requests. Identity is execution-local; it does not assert replay equivalence. This handle is runtime-only and must never be serialized into provider data.
Implementations§
Source§impl AdapterContext
impl AdapterContext
Sourcepub fn operation(&self) -> &str
pub fn operation(&self) -> &str
Caller-owned identity of this logical operation within the execution.
Sourcepub fn new(
sink: Arc<dyn Witness + Send + Sync>,
subject: Subject,
operation: impl Into<String>,
) -> Self
pub fn new( sink: Arc<dyn Witness + Send + Sync>, subject: Subject, operation: impl Into<String>, ) -> Self
Bind a logical operation to its witness and existing subject. The caller must use a non-sensitive, execution-unique operation identity.
Sourcepub fn for_host_attempt(&self, subject: Subject, attempt: NonZeroU64) -> Self
pub fn for_host_attempt(&self, subject: Subject, attempt: NonZeroU64) -> Self
Bind an explicit host attempt to its current dispatch subject.
The logical operation, witness and HTTP send counter remain shared. Existing clones retain their own subject and host ordinal, so an older in-flight attempt cannot be relabeled by a concurrent retry. The host owns ordinal allocation and must start a new context for a changed logical request rather than reusing this operation identity.
Trait Implementations§
Source§impl Clone for AdapterContext
impl Clone for AdapterContext
Auto Trait Implementations§
impl !RefUnwindSafe for AdapterContext
impl !UnwindSafe for AdapterContext
impl Freeze for AdapterContext
impl Send for AdapterContext
impl Sync for AdapterContext
impl Unpin for AdapterContext
impl UnsafeUnpin for AdapterContext
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more