pub struct FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample, const BACKGROUND: bool = false>where
TryIntoSample: ExtractSample,{ /* private fields */ }
👎Deprecated: Use
AdvancedPublisher
and AdvancedSubscriber
instead.Expand description
The builder of FetchingSubscriber
, allowing to configure it.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Implementations§
Source§impl<'a, 'b, KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample> FetchingSubscriberBuilder<'a, 'b, KeySpace, DefaultHandler, Fetch, TryIntoSample>where
TryIntoSample: ExtractSample,
impl<'a, 'b, KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample> FetchingSubscriberBuilder<'a, 'b, KeySpace, DefaultHandler, Fetch, TryIntoSample>where
TryIntoSample: ExtractSample,
Sourcepub fn callback<F>(
self,
callback: F,
) -> FetchingSubscriberBuilder<'a, 'b, KeySpace, Callback<Sample>, Fetch, TryIntoSample>
👎Deprecated: Use AdvancedPublisher
and AdvancedSubscriber
instead.
pub fn callback<F>( self, callback: F, ) -> FetchingSubscriberBuilder<'a, 'b, KeySpace, Callback<Sample>, Fetch, TryIntoSample>
AdvancedPublisher
and AdvancedSubscriber
instead.Add callback to FetchingSubscriber
.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Sourcepub fn callback_mut<F>(
self,
callback: F,
) -> FetchingSubscriberBuilder<'a, 'b, KeySpace, Callback<Sample>, Fetch, TryIntoSample>
👎Deprecated: Use AdvancedPublisher
and AdvancedSubscriber
instead.
pub fn callback_mut<F>( self, callback: F, ) -> FetchingSubscriberBuilder<'a, 'b, KeySpace, Callback<Sample>, Fetch, TryIntoSample>
AdvancedPublisher
and AdvancedSubscriber
instead.Add callback to FetchingSubscriber
.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Using this guarantees that your callback will never be called concurrently.
If your callback is also accepted by the callback
method, we suggest you use it instead of callback_mut
.
Subscriber will not be undeclared when dropped, with the callback running in background until the session is closed.
Sourcepub fn with<Handler>(
self,
handler: Handler,
) -> FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample>where
Handler: IntoHandler<Sample>,
👎Deprecated: Use AdvancedPublisher
and AdvancedSubscriber
instead.
pub fn with<Handler>(
self,
handler: Handler,
) -> FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample>where
Handler: IntoHandler<Sample>,
AdvancedPublisher
and AdvancedSubscriber
instead.Use the given handler to receive Samples.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Source§impl<'a, 'b, KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample> FetchingSubscriberBuilder<'a, 'b, KeySpace, Callback<Sample>, Fetch, TryIntoSample>where
TryIntoSample: ExtractSample,
impl<'a, 'b, KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample> FetchingSubscriberBuilder<'a, 'b, KeySpace, Callback<Sample>, Fetch, TryIntoSample>where
TryIntoSample: ExtractSample,
Sourcepub fn background(
self,
) -> FetchingSubscriberBuilder<'a, 'b, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true>
👎Deprecated: Use AdvancedPublisher
and AdvancedSubscriber
instead.
pub fn background( self, ) -> FetchingSubscriberBuilder<'a, 'b, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true>
AdvancedPublisher
and AdvancedSubscriber
instead.Register the subscriber callback to be run in background until the session is closed.
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
Background builder doesn’t return a FetchingSubscriber
object anymore.
Source§impl<Handler, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample, const BACKGROUND: bool> FetchingSubscriberBuilder<'_, '_, UserSpace, Handler, Fetch, TryIntoSample, BACKGROUND>where
TryIntoSample: ExtractSample,
impl<Handler, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample, const BACKGROUND: bool> FetchingSubscriberBuilder<'_, '_, UserSpace, Handler, Fetch, TryIntoSample, BACKGROUND>where
TryIntoSample: ExtractSample,
Sourcepub fn allowed_origin(self, origin: Locality) -> Self
👎Deprecated: Use AdvancedPublisher
and AdvancedSubscriber
instead.
pub fn allowed_origin(self, origin: Locality) -> Self
AdvancedPublisher
and AdvancedSubscriber
instead.Restrict the matching publications that will be received by this FetchingSubscriber
This API has been marked as unstable: it works as advertised, but it may be changed in a future release.
to the ones that have the given [`Locality`](Locality).Trait Implementations§
Source§impl<KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()> + Send + Sync, TryIntoSample> IntoFuture for FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true>
impl<KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()> + Send + Sync, TryIntoSample> IntoFuture for FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true>
Source§type Output = <FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true> as Resolvable>::To
type Output = <FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true> as Resolvable>::To
The output that the future will produce on completion.
Source§type IntoFuture = Ready<<FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true> as Resolvable>::To>
type IntoFuture = Ready<<FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true> as Resolvable>::To>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Source§impl<KeySpace, Handler, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()> + Send + Sync, TryIntoSample> IntoFuture for FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample>where
KeySpace: Into<KeySpace>,
Handler: IntoHandler<Sample> + Send,
Handler::Handler: Send,
TryIntoSample: ExtractSample + Send + Sync,
impl<KeySpace, Handler, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()> + Send + Sync, TryIntoSample> IntoFuture for FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample>where
KeySpace: Into<KeySpace>,
Handler: IntoHandler<Sample> + Send,
Handler::Handler: Send,
TryIntoSample: ExtractSample + Send + Sync,
Source§type Output = <FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample> as Resolvable>::To
type Output = <FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample> as Resolvable>::To
The output that the future will produce on completion.
Source§type IntoFuture = Ready<<FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample> as Resolvable>::To>
type IntoFuture = Ready<<FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample> as Resolvable>::To>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Source§impl<KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample> Resolvable for FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true>where
TryIntoSample: ExtractSample,
impl<KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample> Resolvable for FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true>where
TryIntoSample: ExtractSample,
Source§impl<KeySpace, Handler, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample> Resolvable for FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample>
impl<KeySpace, Handler, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()>, TryIntoSample> Resolvable for FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample>
Source§impl<KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()> + Send + Sync, TryIntoSample> Wait for FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true>
impl<KeySpace, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()> + Send + Sync, TryIntoSample> Wait for FetchingSubscriberBuilder<'_, '_, KeySpace, Callback<Sample>, Fetch, TryIntoSample, true>
Source§fn wait(self) -> <Self as Resolvable>::To
fn wait(self) -> <Self as Resolvable>::To
Synchronously execute and wait
Source§impl<KeySpace, Handler, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()> + Send + Sync, TryIntoSample> Wait for FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample>where
KeySpace: Into<KeySpace>,
Handler: IntoHandler<Sample> + Send,
Handler::Handler: Send,
TryIntoSample: ExtractSample + Send + Sync,
impl<KeySpace, Handler, Fetch: FnOnce(Box<dyn Fn(TryIntoSample) + Send + Sync>) -> Result<()> + Send + Sync, TryIntoSample> Wait for FetchingSubscriberBuilder<'_, '_, KeySpace, Handler, Fetch, TryIntoSample>where
KeySpace: Into<KeySpace>,
Handler: IntoHandler<Sample> + Send,
Handler::Handler: Send,
TryIntoSample: ExtractSample + Send + Sync,
Source§fn wait(self) -> <Self as Resolvable>::To
fn wait(self) -> <Self as Resolvable>::To
Synchronously execute and wait
Auto Trait Implementations§
impl<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, const BACKGROUND: bool> Freeze for FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, BACKGROUND>
impl<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, const BACKGROUND: bool = false> !RefUnwindSafe for FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, BACKGROUND>
impl<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, const BACKGROUND: bool> Send for FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, BACKGROUND>
impl<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, const BACKGROUND: bool> Sync for FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, BACKGROUND>
impl<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, const BACKGROUND: bool> Unpin for FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, BACKGROUND>
impl<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, const BACKGROUND: bool = false> !UnwindSafe for FetchingSubscriberBuilder<'a, 'b, KeySpace, Handler, Fetch, TryIntoSample, BACKGROUND>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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>
Converts
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>
Converts
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