Struct eventstore_tcp::builder::ReadStreamEventsBuilder
[−]
[src]
pub struct ReadStreamEventsBuilder { /* fields omitted */ }
Builds a package for reading multiple events from a stream in either ReadDirection
.
Example
use eventstore_tcp::{Builder, ReadDirection, StreamVersion}; let package = Builder::read_stream_events() .direction(ReadDirection::Forward) .stream_id("my_stream-1") .from_event_number(StreamVersion::from(42)) .max_count(10) .resolve_link_tos(true) // default .require_master(false) // default .build_package(None, None);
Methods
impl ReadStreamEventsBuilder
[src]
fn direction<D: Into<ReadDirection>>(&mut self, dir: D) -> &mut Self
Set the read direction (required).
fn max_count(&mut self, count: u8) -> &mut Self
Sets the maximum number of events to read (required). Panics if argument is zero.
u8
is used as larger batches should be paged. At the moment maximum buffer requirement
even for 255 events is 255*16MiB > 4000MB.
fn stream_id<S: Into<Cow<'static, str>>>(&mut self, id: S) -> &mut Self
Panics if the id is an empty string
fn from_event_number<N: Into<EventNumber>>(&mut self, n: N) -> &mut Self
Event number to read from to the given direction.
fn resolve_link_tos(&mut self, resolve: bool) -> &mut Self
Whether or not the server should resolve links found in the stream to events of other
streams. Defaults to true
.
fn require_master(&mut self, require: bool) -> &mut Self
Should the server only handle the request if it is the cluster master. Note that while only the master server can accept writes, other cluster members can forward requests to the master.
Defaults to false
.
fn build_package(&mut self,
authentication: Option<UsernamePassword>,
correlation_id: Option<Uuid>)
-> Package
authentication: Option<UsernamePassword>,
correlation_id: Option<Uuid>)
-> Package
Build a package. Will panic if required values are not set. Values of this builder will be moved into the package.