pub struct CallSlot { /* private fields */ }Expand description
Where a connector keeps its CallContext: its own settings, plus the
context the pipeline installs.
Build it in new() from the connector’s config, forward
Source::set_call_context /
Sink::set_call_context to
install, and run calls through call.
Before the pipeline installs anything (a library caller driving the
connector directly) the connector’s own settings and the defaults apply.
Implementations§
Source§impl CallSlot
impl CallSlot
Sourcepub fn new(local: CallContext) -> Self
pub fn new(local: CallContext) -> Self
A slot whose connector-owned settings are local.
Sourcepub fn local(&self) -> &CallContext
pub fn local(&self) -> &CallContext
The connector-owned settings.
Sourcepub fn set_local(&mut self, local: CallContext)
pub fn set_local(&mut self, local: CallContext)
Replace the connector-owned settings (from a builder method).
Sourcepub fn install(&self, ctx: CallContext)
pub fn install(&self, ctx: CallContext)
Install the pipeline’s context. The first call wins.
Sourcepub fn install_recorder(&self, recorder: Arc<RoundtripRecorder>)
pub fn install_recorder(&self, recorder: Arc<RoundtripRecorder>)
Install a round-trip recorder, used when the installed context carries
none (a caller that only calls set_roundtrip_recorder). The first
call wins.
Sourcepub fn get(&self) -> CallContext
pub fn get(&self) -> CallContext
The effective context: the connector’s settings over the installed context, with the separately installed recorder as a fallback.
Sourcepub fn recorder(&self) -> Option<Arc<RoundtripRecorder>>
pub fn recorder(&self) -> Option<Arc<RoundtripRecorder>>
The round-trip recorder in effect, if any.
Sourcepub async fn wait(&self, duration: Duration) -> Result<(), FaucetError>
pub async fn wait(&self, duration: Duration) -> Result<(), FaucetError>
Wait through the effective context (CallContext::wait).
Sourcepub async fn call<T, F, Fut>(
&self,
op: &'static str,
f: F,
) -> Result<T, FaucetError>
pub async fn call<T, F, Fut>( &self, op: &'static str, f: F, ) -> Result<T, FaucetError>
Run f through the effective context (CallContext::call).
Sourcepub async fn call_once<T, Fut>(
&self,
op: &'static str,
fut: Fut,
) -> Result<T, FaucetError>
pub async fn call_once<T, Fut>( &self, op: &'static str, fut: Fut, ) -> Result<T, FaucetError>
Run fut once through the effective context
(CallContext::call_once).
Trait Implementations§
impl RefUnwindSafe for CallSlot
impl UnwindSafe for CallSlot
Auto Trait Implementations§
impl !Freeze for CallSlot
impl Send for CallSlot
impl Sync for CallSlot
impl Unpin for CallSlot
impl UnsafeUnpin for CallSlot
Blanket Implementations§
impl<T> Allocation for T
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request