Struct nats::jetstream::SubscribeOptions
source · [−]pub struct SubscribeOptions { /* private fields */ }
Expand description
Options for subscription
Implementations
sourceimpl SubscribeOptions
impl SubscribeOptions
sourcepub fn bind(stream_name: String, consumer_name: String) -> Self
pub fn bind(stream_name: String, consumer_name: String) -> Self
Binds to an existing consumer from a stream without attempting to create one.
sourcepub fn bind_stream(stream_name: String) -> Self
pub fn bind_stream(stream_name: String) -> Self
Binds the consumer to a stream explicitly based on a name.
When a stream name is not specified, the subject is used as a way to find the stream name. This is done by making a request to the server to get list of stream names that have a filter the subject. To avoid the stream lookup, provide the stream name with this function.
sourcepub fn description(self, description: String) -> Self
pub fn description(self, description: String) -> Self
Sets the description used for the created consumer.
sourcepub fn durable_name(self, consumer: String) -> Self
pub fn durable_name(self, consumer: String) -> Self
Sets the durable name for the created consumer.
sourcepub fn deliver_all(self) -> Self
pub fn deliver_all(self) -> Self
Configures the consumer to receive all the messages from a Stream.
sourcepub fn deliver_last(self) -> Self
pub fn deliver_last(self) -> Self
Configures the consumer to receive messages starting with the latest one.
sourcepub fn deliver_last_per_subject(self) -> Self
pub fn deliver_last_per_subject(self) -> Self
Configures the consumer to receive messages starting with the latest one for each filtered subject.
sourcepub fn deliver_new(self) -> Self
pub fn deliver_new(self) -> Self
Configures the consumer to receive messages published after the subscription.
sourcepub fn deliver_by_start_sequence(self, seq: u64) -> Self
pub fn deliver_by_start_sequence(self, seq: u64) -> Self
Configures a Consumer to receive messages from a start sequence.
sourcepub fn deliver_by_start_time(self, time: DateTime) -> Self
pub fn deliver_by_start_time(self, time: DateTime) -> Self
Configures the consumer to receive messages from a start time.
sourcepub fn ack_all(self) -> Self
pub fn ack_all(self) -> Self
When acking a sequence number, this implicitly acks all sequences below this one as well.
sourcepub fn ack_explicit(self) -> Self
pub fn ack_explicit(self) -> Self
Requires ack or nack for all messages.
sourcepub fn max_deliver(self, n: i64) -> Self
pub fn max_deliver(self, n: i64) -> Self
Sets the number of redeliveries for a message.
sourcepub fn max_ack_pending(self, n: i64) -> Self
pub fn max_ack_pending(self, n: i64) -> Self
Sets the number of outstanding acks that are allowed before message delivery is halted.
sourcepub fn replay_original(self) -> Self
pub fn replay_original(self) -> Self
Replays the messages at the original speed.
sourcepub fn replay_instant(self) -> Self
pub fn replay_instant(self) -> Self
Replays the messages as fast as possible.
sourcepub fn rate_limit(self, n: u64) -> Self
pub fn rate_limit(self, n: u64) -> Self
The bits per second rate limit applied to the push consumer.
sourcepub fn deliver_subject(self, subject: String) -> Self
pub fn deliver_subject(self, subject: String) -> Self
Specifies the consumer deliver subject.
This option is used only in situations where the consumer does not exist and a creation request is sent to the server.
If not provided, an inbox will be selected.
sourcepub fn headers_only(self) -> Self
pub fn headers_only(self) -> Self
Instruct the consumer to only deliver headers and no payloads.
sourcepub fn enable_flow_control(self) -> Self
pub fn enable_flow_control(self) -> Self
Enables flow control
sourcepub fn idle_heartbeat(self, interval: Duration) -> Self
pub fn idle_heartbeat(self, interval: Duration) -> Self
Enables hearbeat messages to be sent.
Trait Implementations
sourceimpl Clone for SubscribeOptions
impl Clone for SubscribeOptions
sourcefn clone(&self) -> SubscribeOptions
fn clone(&self) -> SubscribeOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SubscribeOptions
impl Debug for SubscribeOptions
sourceimpl Default for SubscribeOptions
impl Default for SubscribeOptions
sourcefn default() -> SubscribeOptions
fn default() -> SubscribeOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for SubscribeOptions
impl Send for SubscribeOptions
impl Sync for SubscribeOptions
impl Unpin for SubscribeOptions
impl UnwindSafe for SubscribeOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more