pub struct StreamBuilder<C: CodecType> { /* private fields */ }Expand description
Builder for creating JetStream streams.
Implementations§
Source§impl<C: CodecType> StreamBuilder<C>
impl<C: CodecType> StreamBuilder<C>
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the description for this stream.
Sourcepub fn retention(self, retention: RetentionPolicy) -> Self
pub fn retention(self, retention: RetentionPolicy) -> Self
Set the retention policy.
Sourcepub fn max_messages(self, max: i64) -> Self
pub fn max_messages(self, max: i64) -> Self
Set the maximum number of messages.
Sourcepub fn max_messages_per_subject(self, max: i64) -> Self
pub fn max_messages_per_subject(self, max: i64) -> Self
Set the maximum number of messages per subject.
Sourcepub fn max_message_size(self, max: i32) -> Self
pub fn max_message_size(self, max: i32) -> Self
Set the maximum message size.
Sourcepub fn max_consumers(self, max: i32) -> Self
pub fn max_consumers(self, max: i32) -> Self
Set the maximum number of consumers.
Sourcepub fn storage(self, storage: StorageType) -> Self
pub fn storage(self, storage: StorageType) -> Self
Set the storage type.
Sourcepub fn discard_policy(self, policy: DiscardPolicy) -> Self
pub fn discard_policy(self, policy: DiscardPolicy) -> Self
Set the discard policy.
Sourcepub fn duplicate_window(self, window: Duration) -> Self
pub fn duplicate_window(self, window: Duration) -> Self
Enable or disable duplicate detection window.
Sourcepub fn allow_direct(self, allow: bool) -> Self
pub fn allow_direct(self, allow: bool) -> Self
Allow direct gets.
Sourcepub fn mirror(self, source: StreamSource) -> Self
pub fn mirror(self, source: StreamSource) -> Self
Enable mirroring from another stream.
Sourcepub fn add_source(self, source: StreamSource) -> Self
pub fn add_source(self, source: StreamSource) -> Self
Add a source stream.
Sourcepub fn deny_delete(self, deny: bool) -> Self
pub fn deny_delete(self, deny: bool) -> Self
Set whether to deny delete.
Sourcepub fn deny_purge(self, deny: bool) -> Self
pub fn deny_purge(self, deny: bool) -> Self
Set whether to deny purge.
Sourcepub fn allow_rollup(self, allow: bool) -> Self
pub fn allow_rollup(self, allow: bool) -> Self
Set whether to allow rollup headers.
Sourcepub fn compression(self, compression: Compression) -> Self
pub fn compression(self, compression: Compression) -> Self
Set the compression type.
Sourcepub fn first_sequence(self, seq: u64) -> Self
pub fn first_sequence(self, seq: u64) -> Self
Set the first sequence number.
Sourcepub fn subject_transform(self, source: &str, destination: &str) -> Self
pub fn subject_transform(self, source: &str, destination: &str) -> Self
Set a subject transform.
Sourcepub async fn create_or_update(self) -> Result<Stream<C>>
pub async fn create_or_update(self) -> Result<Stream<C>>
Create or update the stream.
Auto Trait Implementations§
impl<C> Freeze for StreamBuilder<C>
impl<C> !RefUnwindSafe for StreamBuilder<C>
impl<C> Send for StreamBuilder<C>
impl<C> Sync for StreamBuilder<C>
impl<C> Unpin for StreamBuilder<C>where
C: Unpin,
impl<C> !UnwindSafe for StreamBuilder<C>
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