Struct nats::jetstream::SubscribeOptions

source ·
pub struct SubscribeOptions { /* private fields */ }
Expand description

Options for subscription

Implementations§

source§

impl SubscribeOptions

source

pub fn new() -> Self

Creates a new set of default subscription options

source

pub fn bind(stream_name: String, consumer_name: String) -> Self

Binds to an existing consumer from a stream without attempting to create one.

source

pub fn ordered() -> Self

Creates an ordered fifo (first-in-first-out) subscription.

source

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.

source

pub fn description(self, description: String) -> Self

Sets the description used for the created consumer.

source

pub fn durable_name(self, consumer: String) -> Self

Sets the durable name for the created consumer.

source

pub fn deliver_all(self) -> Self

Configures the consumer to receive all the messages from a Stream.

source

pub fn deliver_last(self) -> Self

Configures the consumer to receive messages starting with the latest one.

source

pub fn deliver_last_per_subject(self) -> Self

Configures the consumer to receive messages starting with the latest one for each filtered subject.

source

pub fn deliver_new(self) -> Self

Configures the consumer to receive messages published after the subscription.

source

pub fn deliver_by_start_sequence(self, seq: u64) -> Self

Configures a Consumer to receive messages from a start sequence.

source

pub fn deliver_by_start_time(self, time: DateTime) -> Self

Configures the consumer to receive messages from a start time.

source

pub fn ack_none(self) -> Self

Require no acks for delivered messages.

source

pub fn ack_all(self) -> Self

When acking a sequence number, this implicitly acks all sequences below this one as well.

source

pub fn ack_explicit(self) -> Self

Requires ack or nack for all messages.

source

pub fn max_deliver(self, n: i64) -> Self

Sets the number of redeliveries for a message.

source

pub fn max_ack_pending(self, n: i64) -> Self

Sets the number of outstanding acks that are allowed before message delivery is halted.

source

pub fn replay_original(self) -> Self

Replays the messages at the original speed.

source

pub fn replay_instant(self) -> Self

Replays the messages as fast as possible.

source

pub fn rate_limit(self, n: u64) -> Self

The bits per second rate limit applied to the push consumer.

source

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.

source

pub fn headers_only(self) -> Self

Instruct the consumer to only deliver headers and no payloads.

source

pub fn enable_flow_control(self) -> Self

Enables flow control

source

pub fn idle_heartbeat(self, interval: Duration) -> Self

Enables heartbeat messages to be sent.

Trait Implementations§

source§

impl Clone for SubscribeOptions

source§

fn clone(&self) -> SubscribeOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SubscribeOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SubscribeOptions

source§

fn default() -> SubscribeOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more