pub struct SubscriptionDefinition {
pub subject: String,
pub handler: String,
pub handler_type: HandlerType,
pub config: HashMap<String, String>,
pub stream: Option<String>,
pub ack: AckMode,
pub consumer: Option<ConsumerSpec>,
pub timeout_secs: Option<u32>,
}Fields§
§subject: String§handler: String§handler_type: HandlerType§config: HashMap<String, String>§stream: Option<String>Explicit JetStream stream to host this subscription’s consumer. When
None, the platform uses the tenant stream (DW_{tenant}).
ack: AckModeWhen a delivery is acknowledged.
consumer: Option<ConsumerSpec>The durable consumer’s configuration; the platform’s own when unset.
timeout_secs: Option<u32>The handler’s execution budget; 60 s when unset.
Implementations§
Source§impl SubscriptionDefinition
impl SubscriptionDefinition
pub const DEFAULT_TIMEOUT_SECS: u32 = 60
Sourcepub const TIMEOUT_SECS: RangeInclusive<u32>
pub const TIMEOUT_SECS: RangeInclusive<u32>
The range timeout_secs must fall in.
Sourcepub fn new(
subject: impl Into<String>,
handler: impl Into<String>,
handler_type: HandlerType,
) -> Self
pub fn new( subject: impl Into<String>, handler: impl Into<String>, handler_type: HandlerType, ) -> Self
A subscription with the platform’s delivery defaults.
Sourcepub fn derived_features(&self) -> impl Iterator<Item = &'static str>
pub fn derived_features(&self) -> impl Iterator<Item = &'static str>
Platform features this subscription’s declaration requires.
Trait Implementations§
Source§impl Clone for SubscriptionDefinition
impl Clone for SubscriptionDefinition
Source§impl Debug for SubscriptionDefinition
impl Debug for SubscriptionDefinition
Source§impl Default for SubscriptionDefinition
impl Default for SubscriptionDefinition
Source§impl<'de> Deserialize<'de> for SubscriptionDefinition
impl<'de> Deserialize<'de> for SubscriptionDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SubscriptionDefinition
impl RefUnwindSafe for SubscriptionDefinition
impl Send for SubscriptionDefinition
impl Sync for SubscriptionDefinition
impl Unpin for SubscriptionDefinition
impl UnsafeUnpin for SubscriptionDefinition
impl UnwindSafe for SubscriptionDefinition
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