pub struct StreamMetadata {
    pub max_count: Option<u64>,
    pub max_age: Option<Duration>,
    pub truncate_before: Option<u64>,
    pub cache_control: Option<Duration>,
    pub acl: Option<Acl>,
    pub custom_properties: HashMap<String, Value>,
}
Expand description

Represents stream metadata with strongly types properties for system values and a dictionary-like interface for custom values.

Fields

max_count: Option<u64>

A sliding window based on the number of items in the stream. When data reaches a certain length it disappears automatically from the stream and is considered eligible for scavenging.

max_age: Option<Duration>

A sliding window based on dates. When data reaches a certain age it disappears automatically from the stream and is considered eligible for scavenging.

truncate_before: Option<u64>

The event number from which previous events can be scavenged. This is used to implement soft-deletion of streams.

cache_control: Option<Duration>

Controls the cache of the head of a stream. Most URIs in a stream are infinitely cacheable but the head by default will not cache. It may be preferable in some situations to set a small amount of caching on the head to allow intermediaries to handle polls (say 10 seconds).

acl: Option<Acl>

The access control list for the stream.

custom_properties: HashMap<String, Value>

An enumerable of key-value pairs of keys to JSON value for user-provided metadata.

Implementations

Initializes a fresh stream metadata builder.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

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

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

Calls U::from(self).

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

Wrap the input message T in a tonic::Request

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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