pub struct SubscriberConfig {
pub project_id: String,
pub subscription_name: String,
pub subscription_type: SubscriptionType,
pub ack_deadline_seconds: i64,
pub flow_control: FlowControlSettings,
pub handler_concurrency: usize,
pub enable_ordering: bool,
pub dead_letter_config: Option<DeadLetterConfig>,
pub endpoint: Option<String>,
pub auto_extend_deadline: bool,
}Expand description
Configuration for the subscriber.
Fields§
§project_id: StringProject ID.
subscription_name: StringSubscription name.
subscription_type: SubscriptionTypeSubscription type.
ack_deadline_seconds: i64Acknowledgment deadline in seconds.
flow_control: FlowControlSettingsFlow control settings.
handler_concurrency: usizeMessage handler concurrency.
enable_ordering: boolEnable message ordering.
dead_letter_config: Option<DeadLetterConfig>Dead letter queue configuration.
endpoint: Option<String>Custom endpoint (for testing).
auto_extend_deadline: boolAutomatically extend acknowledgment deadlines.
Implementations§
Source§impl SubscriberConfig
impl SubscriberConfig
Sourcepub fn new(
project_id: impl Into<String>,
subscription_name: impl Into<String>,
) -> Self
pub fn new( project_id: impl Into<String>, subscription_name: impl Into<String>, ) -> Self
Creates a new subscriber configuration.
Sourcepub fn with_type(self, subscription_type: SubscriptionType) -> Self
pub fn with_type(self, subscription_type: SubscriptionType) -> Self
Sets the subscription type.
Sourcepub fn with_ack_deadline(self, seconds: i64) -> Self
pub fn with_ack_deadline(self, seconds: i64) -> Self
Sets the acknowledgment deadline.
Sourcepub fn with_flow_control(self, settings: FlowControlSettings) -> Self
pub fn with_flow_control(self, settings: FlowControlSettings) -> Self
Sets the flow control settings.
Sourcepub fn with_handler_concurrency(self, concurrency: usize) -> Self
pub fn with_handler_concurrency(self, concurrency: usize) -> Self
Sets the handler concurrency.
Sourcepub fn with_ordering(self, enable: bool) -> Self
pub fn with_ordering(self, enable: bool) -> Self
Enables message ordering.
Sourcepub fn with_dead_letter(self, config: DeadLetterConfig) -> Self
pub fn with_dead_letter(self, config: DeadLetterConfig) -> Self
Sets the dead letter queue configuration.
Sourcepub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn with_endpoint(self, endpoint: impl Into<String>) -> Self
Sets a custom endpoint.
Trait Implementations§
Source§impl Clone for SubscriberConfig
impl Clone for SubscriberConfig
Source§fn clone(&self) -> SubscriberConfig
fn clone(&self) -> SubscriberConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SubscriberConfig
impl Debug for SubscriberConfig
Auto Trait Implementations§
impl Freeze for SubscriberConfig
impl RefUnwindSafe for SubscriberConfig
impl Send for SubscriberConfig
impl Sync for SubscriberConfig
impl Unpin for SubscriberConfig
impl UnsafeUnpin for SubscriberConfig
impl UnwindSafe for SubscriberConfig
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request