Struct eventstore::prelude::Client[][src]

pub struct Client { /* fields omitted */ }

Represents a client to a single node. Client maintains a full duplex communication to EventStoreDB.

Many threads can use an EventStoreDB client at the same time or a single thread can make many asynchronous requests.

Implementations

impl Client[src]

pub async fn create(settings: ClientSettings) -> Result<Self, Box<dyn Error>>[src]

Creates a gRPC client to an EventStoreDB database.

pub async fn append_to_stream<StreamName, Events>(
    &self,
    stream_name: StreamName,
    options: &AppendToStreamOptions,
    events: Events
) -> Result<Result<WriteResult, WrongExpectedVersion>> where
    StreamName: AsRef<str>,
    Events: ToEvents + 'static, 
[src]

Sends events to a given stream.

pub async fn read_stream<StreamName, Count>(
    &self,
    stream_name: StreamName,
    options: &ReadStreamOptions,
    count: Count
) -> Result<ReadResult<Count::Selection>> where
    StreamName: AsRef<str>,
    Count: ToCount<'static>, 
[src]

Reads events from a given stream. The reading can be done forward and backward.

pub async fn read_all<Count>(
    &self,
    options: &ReadAllOptions,
    count: Count
) -> Result<Count::Selection> where
    Count: ToCount<'static>, 
[src]

Reads events for the system stream $all. The reading can be done forward and backward.

pub async fn delete_stream<StreamName>(
    &self,
    stream_name: StreamName,
    options: &DeleteStreamOptions
) -> Result<Option<Position>> where
    StreamName: AsRef<str>, 
[src]

Deletes a given stream. By default, the server performs a soft delete.

pub async fn subscribe_to_stream<'a, StreamName>(
    &self,
    stream_name: StreamName,
    options: &SubscribeToStreamOptions
) -> Result<BoxStream<'a, Result<SubEvent>>> where
    StreamName: AsRef<str>, 
[src]

Subscribes to a given stream. This kind of subscription specifies a starting point (by default, the beginning of a stream). For a regular stream, that starting point will be an event number. For the system stream $all, it will be a position in the transaction file (see subscribe_to_all). This subscription will fetch every event until the end of the stream, then will dispatch subsequently written events.

For example, if a starting point of 50 is specified when a stream has 100 events in it, the subscriber can expect to see events 51 through 100, and then any events subsequently written events until such time as the subscription is dropped or closed.

pub async fn subscribe_to_all<'a>(
    &self,
    options: &SubscribeToAllOptions
) -> Result<BoxStream<'a, Result<SubEvent>>>
[src]

Like subscribe_to_stream but specific to system $all stream.

pub async fn create_persistent_subscription<StreamName, GroupName>(
    &self,
    stream_name: StreamName,
    group_name: GroupName,
    options: &PersistentSubscriptionOptions
) -> Result<()> where
    StreamName: AsRef<str>,
    GroupName: AsRef<str>, 
[src]

Creates a persistent subscription group on a stream.

Persistent subscriptions are special kind of subscription where the server remembers the state of the subscription. This allows for many different modes of operations compared to a regular or catchup subscription where the client holds the subscription state.

pub async fn update_persistent_subscription<StreamName, GroupName>(
    &self,
    stream_name: StreamName,
    group_name: GroupName,
    options: &PersistentSubscriptionOptions
) -> Result<()> where
    StreamName: AsRef<str>,
    GroupName: AsRef<str>, 
[src]

Updates a persistent subscription group on a stream.

pub async fn delete_persistent_subscription<StreamName, GroupName>(
    &self,
    stream_name: StreamName,
    group_name: GroupName,
    options: &DeletePersistentSubscriptionOptions
) -> Result<()> where
    StreamName: AsRef<str>,
    GroupName: AsRef<str>, 
[src]

Deletes a persistent subscription group on a stream.

pub async fn connect_persistent_subscription<StreamName, GroupName>(
    &self,
    stream_name: StreamName,
    group_name: GroupName,
    options: &ConnectToPersistentSubscription
) -> Result<(SubscriptionRead, SubscriptionWrite)> where
    StreamName: AsRef<str>,
    GroupName: AsRef<str>, 
[src]

Connects to a persistent subscription group on a stream.

Trait Implementations

impl Clone for Client[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]