Struct eventstore::StreamMetadataBuilder
source · [−]pub struct StreamMetadataBuilder { /* private fields */ }
Expand description
Used to facilitate the creation of a stream’s metadata.
Implementations
sourceimpl StreamMetadataBuilder
impl StreamMetadataBuilder
sourcepub fn new() -> StreamMetadataBuilder
pub fn new() -> StreamMetadataBuilder
Creates a StreamMetadata
initialized with default values.
sourcepub fn max_count(self, value: u64) -> StreamMetadataBuilder
pub fn max_count(self, value: u64) -> StreamMetadataBuilder
Sets 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.
sourcepub fn max_age(self, value: Duration) -> StreamMetadataBuilder
pub fn max_age(self, value: Duration) -> StreamMetadataBuilder
Sets a sliding window based on dates. When data reaches a certain age it disappears automatically from the stream and is considered eligible for scavenging.
sourcepub fn truncate_before(self, value: u64) -> StreamMetadataBuilder
pub fn truncate_before(self, value: u64) -> StreamMetadataBuilder
Sets the event number from which previous events can be scavenged.
sourcepub fn cache_control(self, value: Duration) -> StreamMetadataBuilder
pub fn cache_control(self, value: Duration) -> StreamMetadataBuilder
This 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).
sourcepub fn acl(self, value: Acl) -> StreamMetadataBuilder
pub fn acl(self, value: Acl) -> StreamMetadataBuilder
Sets the ACL of a stream.
sourcepub fn insert_custom_property<V>(
self,
key: impl AsRef<str>,
value: V
) -> StreamMetadataBuilder where
V: Serialize,
pub fn insert_custom_property<V>(
self,
key: impl AsRef<str>,
value: V
) -> StreamMetadataBuilder where
V: Serialize,
Adds user-defined property in the stream metadata.
sourcepub fn build(self) -> StreamMetadata
pub fn build(self) -> StreamMetadata
Returns a properly configured StreamMetaData
.
Trait Implementations
sourceimpl Default for StreamMetadataBuilder
impl Default for StreamMetadataBuilder
sourcefn default() -> StreamMetadataBuilder
fn default() -> StreamMetadataBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for StreamMetadataBuilder
impl Send for StreamMetadataBuilder
impl Sync for StreamMetadataBuilder
impl Unpin for StreamMetadataBuilder
impl UnwindSafe for StreamMetadataBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcepub fn into_request(self) -> Request<T>
pub fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more