Struct eventstore_tcp::builder::NewEventBuilder
[−]
[src]
pub struct NewEventBuilder<'a> { /* fields omitted */ }
Builder for specifying an event when using WriteEventsBuilder
.
Methods
impl<'a> NewEventBuilder<'a>
[src]
fn event_id(self, event_id: Uuid) -> Self
Sets the event identifier. If not specified a new random Uuid will be generated.
fn event_type<S: Into<Cow<'static, str>>>(self, ty: S) -> Self
Specifies the event type.
fn data<D: Into<Vec<u8>>>(self, data: D) -> Self
Sets the data of the event.
fn data_content_type(self, content_type: ContentType) -> Self
Sets the content type of the event, defaults to ContentType::Bytes
fn metadata<D: Into<Vec<u8>>>(self, metadata: D) -> Self
Sets the metadata of the event.
fn metadata_content_type(self, content_type: ContentType) -> Self
Sets the content type of the event, defaults to ContentType::Bytes
fn done(self) -> &'a mut WriteEventsBuilder
Completes building a new event for WriteEventsBuilder
by adding a new
event to the builder and returning it.
The server has a hard limit on the size of new events accepted, but this method currently builder currently does no size validation. Expect attempting to write over about 16MiB events (data + metadata + on-disk framing) to fail.
fn cancel(self) -> &'a mut WriteEventsBuilder
Cancels building this new event returning the WriteEventsBuilder
unmodified.