[][src]Struct eventstore::Client

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 fn write_events<S>(&self, stream: S) -> WriteEvents where
    S: AsRef<str>, 
[src]

Sends events to a given stream.

pub fn read_stream<S>(&self, stream: S) -> ReadStreamEvents where
    S: AsRef<str>, 
[src]

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

pub fn read_all(&self) -> ReadAllEvents[src]

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

pub fn delete_stream<S>(&self, stream: S) -> DeleteStream where
    S: AsRef<str>, 
[src]

Deletes a given stream. By default, the server performs a soft delete, More information can be found on the [Deleting streams and events] page.

pub fn subscribe_to_stream_from<S>(&self, stream: S) -> RegularCatchupSubscribe where
    S: 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_from). 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 subsequenttly written events until such time as the subscription is dropped or closed.

pub fn subscribe_to_all_from(&self) -> AllCatchupSubscribe[src]

Like subscribe_to_stream_from but specific to system $all stream.

pub fn create_persistent_subscription<S>(
    &self,
    stream_id: S,
    group_name: S
) -> CreatePersistentSubscription where
    S: 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 fn update_persistent_subscription<S>(
    &self,
    stream_id: S,
    group_name: S
) -> UpdatePersistentSubscription where
    S: AsRef<str>, 
[src]

Updates a persistent subscription group on a stream.

pub fn delete_persistent_subscription<S>(
    &self,
    stream_id: S,
    group_name: S
) -> DeletePersistentSubscription where
    S: AsRef<str>, 
[src]

Deletes a persistent subscription group on a stream.

pub fn connect_persistent_subscription<S>(
    &self,
    stream_id: S,
    group_name: S
) -> ConnectToPersistentSubscription where
    S: AsRef<str>, 
[src]

Connects to a persistent subscription group on a stream.

Trait Implementations

impl Clone for Client[src]

Auto Trait Implementations

impl !RefUnwindSafe for Client

impl Send for Client

impl Sync for Client

impl Unpin for Client

impl !UnwindSafe for Client

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> 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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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]