[−][src]Struct eventstore::Client
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]
S: AsRef<str>,
Sends events to a given stream.
pub fn read_stream<S>(&self, stream: S) -> ReadStreamEvents where
S: AsRef<str>,
[src]
S: AsRef<str>,
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]
S: AsRef<str>,
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]
S: AsRef<str>,
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]
&self,
stream_id: S,
group_name: S
) -> CreatePersistentSubscription where
S: AsRef<str>,
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]
&self,
stream_id: S,
group_name: S
) -> UpdatePersistentSubscription where
S: AsRef<str>,
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]
&self,
stream_id: S,
group_name: S
) -> DeletePersistentSubscription where
S: AsRef<str>,
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]
&self,
stream_id: S,
group_name: S
) -> ConnectToPersistentSubscription where
S: AsRef<str>,
Connects to a persistent subscription group on a stream.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,