[−][src]Struct nakadion::api::ApiClient
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]
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]
prefix: T
) -> Result<Builder, Error>
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]
&mut self,
on_retry: F
)
pub fn on_retry<F: Fn(&NakadiApiError, Duration) + Send + Sync + 'static>(
self,
on_retry: F
) -> Self
[src]
self,
on_retry: F
) -> Self
Trait Implementations
impl Clone for ApiClient
[src]
impl Debug for ApiClient
[src]
impl MonitoringApi for ApiClient
[src]
pub fn get_cursor_distances<T: Into<FlowId>>(
&self,
name: &EventTypeName,
query: &[CursorDistanceQuery],
flow_id: T
) -> ApiFuture<'_, Vec<CursorDistanceResult>>
[src]
&self,
name: &EventTypeName,
query: &[CursorDistanceQuery],
flow_id: T
) -> ApiFuture<'_, Vec<CursorDistanceResult>>
pub fn get_cursor_lag<T: Into<FlowId>>(
&self,
name: &EventTypeName,
cursors: &[Cursor],
flow_id: T
) -> ApiFuture<'_, Vec<Partition>>
[src]
&self,
name: &EventTypeName,
cursors: &[Cursor],
flow_id: T
) -> ApiFuture<'_, Vec<Partition>>
pub fn get_event_type_partitions<T: Into<FlowId>>(
&self,
event_type: &EventTypeName,
flow_id: T
) -> ApiFuture<'_, Vec<Partition>>
[src]
&self,
event_type: &EventTypeName,
flow_id: T
) -> ApiFuture<'_, Vec<Partition>>
impl PublishApi for ApiClient
[src]
pub fn publish_events_batch<'a, B: Into<Bytes>, T: Into<FlowId>>(
&'a self,
event_type: &'a EventTypeName,
events: B,
flow_id: T
) -> PublishFuture<'a>
[src]
&'a self,
event_type: &'a EventTypeName,
events: B,
flow_id: T
) -> PublishFuture<'a>
impl SchemaRegistryApi for ApiClient
[src]
pub fn list_event_types<T: Into<FlowId>>(
&self,
flow_id: T
) -> ApiFuture<'_, Vec<EventType>>
[src]
&self,
flow_id: T
) -> ApiFuture<'_, Vec<EventType>>
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]
&self,
event_type: &EventTypeInput,
flow_id: T
) -> ApiFuture<'_, ()>
Creates a new EventType.
See also Nakadi Manual
pub fn get_event_type<T: Into<FlowId>>(
&self,
name: &EventTypeName,
flow_id: T
) -> ApiFuture<'_, EventType>
[src]
&self,
name: &EventTypeName,
flow_id: T
) -> ApiFuture<'_, EventType>
pub fn update_event_type<T: Into<FlowId>>(
&self,
name: &EventTypeName,
event_type: &EventType,
flow_id: T
) -> ApiFuture<'_, ()>
[src]
&self,
name: &EventTypeName,
event_type: &EventType,
flow_id: T
) -> ApiFuture<'_, ()>
pub fn delete_event_type<T: Into<FlowId>>(
&self,
name: &EventTypeName,
flow_id: T
) -> ApiFuture<'_, ()>
[src]
&self,
name: &EventTypeName,
flow_id: T
) -> ApiFuture<'_, ()>
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]
&self,
input: &SubscriptionInput,
flow_id: T
) -> ApiFuture<'_, Subscription>
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]
&self,
id: SubscriptionId,
flow_id: T
) -> ApiFuture<'_, Subscription>
Returns a subscription identified by id.
See also Nakadi Manual
pub fn list_subscriptions<T: Into<FlowId>>(
&self,
event_type: Option<&EventTypeName>,
owning_application: Option<&OwningApplication>,
limit: Option<usize>,
offset: Option<usize>,
show_status: bool,
flow_id: T
) -> BoxStream<'static, Result<Subscription, NakadiApiError>>
[src]
&self,
event_type: Option<&EventTypeName>,
owning_application: Option<&OwningApplication>,
limit: Option<usize>,
offset: Option<usize>,
show_status: bool,
flow_id: T
) -> BoxStream<'static, Result<Subscription, NakadiApiError>>
pub fn update_auth<T: Into<FlowId>>(
&self,
input: &SubscriptionInput,
flow_id: T
) -> ApiFuture<'_, ()>
[src]
&self,
input: &SubscriptionInput,
flow_id: T
) -> ApiFuture<'_, ()>
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]
&self,
id: SubscriptionId,
flow_id: T
) -> ApiFuture<'_, ()>
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]
&self,
id: SubscriptionId,
flow_id: T
) -> ApiFuture<'_, Vec<SubscriptionCursor>>
Exposes the currently committed offsets of a subscription.
See also Nakadi Manual
pub fn get_subscription_stats<T: Into<FlowId>>(
&self,
id: SubscriptionId,
show_time_lag: bool,
flow_id: T
) -> ApiFuture<'_, SubscriptionStats>
[src]
&self,
id: SubscriptionId,
show_time_lag: bool,
flow_id: T
) -> ApiFuture<'_, SubscriptionStats>
pub fn reset_subscription_cursors<T: Into<FlowId>>(
&self,
id: SubscriptionId,
cursors: &[EventTypeCursor],
flow_id: T
) -> ApiFuture<'_, ()>
[src]
&self,
id: SubscriptionId,
cursors: &[EventTypeCursor],
flow_id: T
) -> ApiFuture<'_, ()>
Reset subscription offsets to specified values.
See also Nakadi Manual
impl SubscriptionCommitApi for ApiClient
[src]
pub fn commit_cursors<T: Into<FlowId>>(
&self,
id: SubscriptionId,
stream: StreamId,
cursors: &[SubscriptionCursor],
flow_id: T
) -> ApiFuture<'_, CursorCommitResults>
[src]
&self,
id: SubscriptionId,
stream: StreamId,
cursors: &[SubscriptionCursor],
flow_id: T
) -> ApiFuture<'_, CursorCommitResults>
impl SubscriptionStreamApi for ApiClient
[src]
pub fn request_stream<'a, T: Into<FlowId>>(
&'a self,
subscription_id: SubscriptionId,
parameters: &StreamParameters,
flow_id: T
) -> ApiFuture<'a, SubscriptionStreamChunks>
[src]
&'a self,
subscription_id: SubscriptionId,
parameters: &StreamParameters,
flow_id: T
) -> ApiFuture<'a, SubscriptionStreamChunks>
Auto Trait Implementations
impl !RefUnwindSafe for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl !UnwindSafe for ApiClient
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> StreamingEssentials for T where
T: SubscriptionStreamApi + SubscriptionCommitApi + Send + Sync + 'static,
[src]
T: SubscriptionStreamApi + SubscriptionCommitApi + Send + Sync + 'static,
impl<S> SubscriptionApiExt for S where
S: SubscriptionApi + Send + Sync + 'static,
[src]
S: SubscriptionApi + Send + Sync + 'static,
pub fn reset_cursors_to_begin<T>(
&Self,
SubscriptionId,
T
) -> Pin<Box<dyn Future<Output = Result<(), NakadiApiError>> + Send, Global>> where
T: Into<FlowId>,
[src]
&Self,
SubscriptionId,
T
) -> Pin<Box<dyn Future<Output = Result<(), NakadiApiError>> + Send, Global>> where
T: Into<FlowId>,
Resets all cursors of the given subscription to CursorOffset::Begin
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>,