[][src]Struct nakadion::api::ApiClient

pub struct ApiClient { /* fields omitted */ }

A client to connect to the API of Nakadi.

The actual HTTP client is pluggable via the DispatchHttpRequest trait.

The ApiClient does retries with exponential backoff and jitter except for the following trait methods:

  • SubscriptionApi::request_stream
  • SubscriptionApi::commit_cursors
  • PublishApi::publish_events_batch

on_retry

A closure to be called before a retry. The error which caused the retry and the time until the retry will be made is passed. This closure overrides the current one and will be used for all subsequent clones of this instance. This allows users to give context on the call site.

Implementations

impl ApiClient[src]

pub fn builder() -> Builder[src]

👎 Deprecated since 0.28.12:

misleading name. builder is just the empty defaulte. use default_builder

pub fn default_builder() -> Builder[src]

Get a default builder

There are also methods to get a Builder which is initialized from the environment:

  • Builder::builder_from_env
  • Builder::builder_from_env_prefixed

pub fn builder_from_env_prefixed<T: AsRef<str>>(
    prefix: T
) -> Result<Builder, Error>
[src]

Get a builde filled from the environment

Values are filled from prefixed environment variables

pub fn builder_from_env() -> Result<Builder, Error>[src]

Get a builde filled from the environment

Values must be prefixed with NAKADION

pub fn set_on_retry<F: Fn(&NakadiApiError, Duration) + Send + Sync + 'static>(
    &mut self,
    on_retry: F
)
[src]

pub fn on_retry<F: Fn(&NakadiApiError, Duration) + Send + Sync + 'static>(
    mut self: Self,
    on_retry: F
) -> Self
[src]

Trait Implementations

impl Clone for ApiClient[src]

impl Debug for ApiClient[src]

impl MonitoringApi for ApiClient[src]

impl PublishApi for ApiClient[src]

impl SchemaRegistryApi for ApiClient[src]

pub fn list_event_types<T: Into<FlowId>>(
    &self,
    flow_id: T
) -> ApiFuture<'_, Vec<EventType>>
[src]

Returns a list of all registered EventTypes

See also Nakadi Manual

pub fn create_event_type<T: Into<FlowId>>(
    &self,
    event_type: &EventTypeInput,
    flow_id: T
) -> ApiFuture<'_, ()>
[src]

Creates a new EventType.

See also Nakadi Manual

pub fn delete_event_type<T: Into<FlowId>>(
    &self,
    name: &EventTypeName,
    flow_id: T
) -> ApiFuture<'_, ()>
[src]

Deletes an EventType identified by its name.

See also Nakadi Manual

impl SubscriptionApi for ApiClient[src]

pub fn create_subscription<T: Into<FlowId>>(
    &self,
    input: &SubscriptionInput,
    flow_id: T
) -> ApiFuture<'_, Subscription>
[src]

This endpoint creates a subscription for EventTypes.

See also Nakadi Manual

pub fn get_subscription<T: Into<FlowId>>(
    &self,
    id: SubscriptionId,
    flow_id: T
) -> ApiFuture<'_, Subscription>
[src]

Returns a subscription identified by id.

See also Nakadi Manual

pub fn update_auth<T: Into<FlowId>>(
    &self,
    input: &SubscriptionInput,
    flow_id: T
) -> ApiFuture<'_, ()>
[src]

This endpoint only allows to update the authorization section of a subscription.

All other properties are immutable. This operation is restricted to subjects with administrative role. This call captures the timestamp of the update request.

See also Nakadi Manual

pub fn delete_subscription<T: Into<FlowId>>(
    &self,
    id: SubscriptionId,
    flow_id: T
) -> ApiFuture<'_, ()>
[src]

Deletes a subscription.

See also Nakadi Manual

pub fn get_subscription_cursors<T: Into<FlowId>>(
    &self,
    id: SubscriptionId,
    flow_id: T
) -> ApiFuture<'_, Vec<SubscriptionCursor>>
[src]

Exposes the currently committed offsets of a subscription.

See also Nakadi Manual

pub fn reset_subscription_cursors<T: Into<FlowId>>(
    &self,
    id: SubscriptionId,
    cursors: &[EventTypeCursor],
    flow_id: T
) -> ApiFuture<'_, ()>
[src]

Reset subscription offsets to specified values.

See also Nakadi Manual

impl SubscriptionCommitApi for ApiClient[src]

impl SubscriptionStreamApi for ApiClient[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> 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> Pointable for T

type Init = T

The type for initializers.

impl<T> StreamingEssentials for T where
    T: SubscriptionStreamApi + SubscriptionCommitApi + Send + Sync + 'static, 
[src]

impl<S> SubscriptionApiExt for S where
    S: SubscriptionApi + Send + Sync + 'static, 
[src]

pub fn reset_cursors_to_begin<T>(
    &Self,
    SubscriptionId,
    T
) -> Pin<Box<dyn Future<Output = Result<(), NakadiApiError>> + Send, Global>> where
    T: Into<FlowId>, 
[src]

Resets all cursors of the given subscription to CursorOffset::Begin

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>,