Struct eventstore::StreamMetadataBuilder
source · pub struct StreamMetadataBuilder { /* private fields */ }
Expand description
Used to facilitate the creation of a stream’s metadata.
Implementations§
source§impl 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
) -> StreamMetadataBuilderwhere
V: Serialize,
pub fn insert_custom_property<V>(
self,
key: impl AsRef<str>,
value: V
) -> StreamMetadataBuilderwhere
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§
source§impl Default for StreamMetadataBuilder
impl Default for StreamMetadataBuilder
source§fn default() -> StreamMetadataBuilder
fn default() -> StreamMetadataBuilder
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§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request