pub struct StreamConfig {
pub content_type: String,
pub ttl_seconds: Option<u64>,
pub expires_at: Option<DateTime<Utc>>,
pub created_closed: bool,
}Expand description
Stream configuration
Immutable configuration set at stream creation time.
Custom PartialEq: when ttl_seconds is Some, expires_at is
derived from Utc::now() and will drift between requests. The
comparison therefore ignores expires_at in that case. When
ttl_seconds is None and expires_at was set directly (via
Expires-At header), the parsed timestamp is stable so we compare it.
Fields§
§content_type: StringContent-Type header value (normalized, lowercase)
ttl_seconds: Option<u64>Time-to-live in seconds (optional)
expires_at: Option<DateTime<Utc>>Absolute expiration time (optional)
created_closed: boolWhether the stream was created closed
Implementations§
Source§impl StreamConfig
impl StreamConfig
Sourcepub fn with_expires_at(self, expires_at: DateTime<Utc>) -> Self
pub fn with_expires_at(self, expires_at: DateTime<Utc>) -> Self
Set absolute expiration time
Sourcepub fn with_created_closed(self, created_closed: bool) -> Self
pub fn with_created_closed(self, created_closed: bool) -> Self
Set created closed flag
Trait Implementations§
Source§impl Clone for StreamConfig
impl Clone for StreamConfig
Source§fn clone(&self) -> StreamConfig
fn clone(&self) -> StreamConfig
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 StreamConfig
impl Debug for StreamConfig
Source§impl<'de> Deserialize<'de> for StreamConfig
impl<'de> Deserialize<'de> for StreamConfig
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
Source§impl PartialEq for StreamConfig
impl PartialEq for StreamConfig
Source§impl Serialize for StreamConfig
impl Serialize for StreamConfig
impl Eq for StreamConfig
Auto Trait Implementations§
impl Freeze for StreamConfig
impl RefUnwindSafe for StreamConfig
impl Send for StreamConfig
impl Sync for StreamConfig
impl Unpin for StreamConfig
impl UnsafeUnpin for StreamConfig
impl UnwindSafe for StreamConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.