pub struct Name(/* private fields */);Expand description
The default SubscriptionSource: subscribe by name string via the Subscribe capability.
Produced by #[subscriber("name")] and usable directly with any connected broker implementing
Subscribe.
§Examples
use ruststream::{Name, Subscribe, SubscriptionSource};
async fn open<C: Subscribe>(connected: &C) -> Result<C::Subscriber, C::Error> {
Name::new("orders").subscribe(connected).await
}Implementations§
Trait Implementations§
Source§impl IntoSource for Name
impl IntoSource for Name
Source§impl<C> RedeliveryAddressed<C> for Namewhere
C: Subscribe<Copies = AddressedCopies>,
Where the broker says a subscribe name is also a publish destination, the name is the address,
and no lookup stands between the descriptor and the answer.
impl<C> RedeliveryAddressed<C> for Namewhere
C: Subscribe<Copies = AddressedCopies>,
Where the broker says a subscribe name is also a publish destination, the name is the address, and no lookup stands between the descriptor and the answer.
Source§fn redelivery_address(
&self,
_connected: &C,
) -> impl Future<Output = Result<RedeliveryAddress, <C as ConnectedBroker>::Error>> + Send
fn redelivery_address( &self, _connected: &C, ) -> impl Future<Output = Result<RedeliveryAddress, <C as ConnectedBroker>::Error>> + Send
Where a publish reaches this subscription again. Read more
Source§impl<C> SubscriptionSource<C> for Namewhere
C: Subscribe,
impl<C> SubscriptionSource<C> for Namewhere
C: Subscribe,
Source§fn declare_retry_on(
&self,
connected: &C,
declaration: &RetryDeclaration,
) -> Result<(), DeclareRetryError>
fn declare_retry_on( &self, connected: &C, declaration: &RetryDeclaration, ) -> Result<(), DeclareRetryError>
A name carries no topology of its own, so what the registration declared is the broker’s to take: it answers for the subscription this name opens.
Source§type Subscriber = <C as Subscribe>::Subscriber
type Subscriber = <C as Subscribe>::Subscriber
The subscriber type this source opens.
Source§type Copies = <C as Subscribe>::Copies
type Copies = <C as Subscribe>::Copies
Who publishes the copies this subscription’s retries are made of, and who names where they
go:
AddressedCopies, NamedCopies or BrokerMoves. Read moreSource§async fn subscribe(
self,
connected: &C,
) -> Result<<Name as SubscriptionSource<C>>::Subscriber, <C as ConnectedBroker>::Error>
async fn subscribe( self, connected: &C, ) -> Result<<Name as SubscriptionSource<C>>::Subscriber, <C as ConnectedBroker>::Error>
Opens the subscription against the connected broker. Called once at startup. Read more
Source§fn declare_retry(self, declaration: &RetryDeclaration) -> Selfwhere
Self: Sized,
fn declare_retry(self, declaration: &RetryDeclaration) -> Selfwhere
Self: Sized,
Takes the registration’s retry declaration into the descriptor, before the subscription
opens. Read more
Source§fn channel_bindings(&self) -> Bindings
fn channel_bindings(&self) -> Bindings
What this subscription adds to its channel in the generated
AsyncAPI document. Read moreSource§fn operation_bindings(&self) -> Bindings
fn operation_bindings(&self) -> Bindings
What this subscription adds to its
receive operation in the document. Read moreSource§fn message_bindings(&self) -> Bindings
fn message_bindings(&self) -> Bindings
What this subscription adds to the messages that arrive on it. Read more
Auto Trait Implementations§
impl Freeze for Name
impl RefUnwindSafe for Name
impl Send for Name
impl Sync for Name
impl Unpin for Name
impl UnsafeUnpin for Name
impl UnwindSafe for Name
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
Mutably borrows from an owned value. Read more
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> ⓘ
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