[−][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.
Methods
impl ApiClient
[src]
pub fn builder() -> Builder
[src]
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]
fn get_cursor_distances<T: Into<FlowId>>(
&self,
name: &EventTypeName,
query: &CursorDistanceQuery,
flow_id: T
) -> ApiFuture<CursorDistanceResult>
[src]
&self,
name: &EventTypeName,
query: &CursorDistanceQuery,
flow_id: T
) -> ApiFuture<CursorDistanceResult>
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>>
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]
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]
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
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
fn get_event_type<T: Into<FlowId>>(
&self,
name: &EventTypeName,
flow_id: T
) -> ApiFuture<EventType>
[src]
&self,
name: &EventTypeName,
flow_id: T
) -> ApiFuture<EventType>
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<()>
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]
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
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
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>>
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
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
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
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>
fn reset_subscription_cursors<T: Into<FlowId>>(
&self,
id: SubscriptionId,
cursors: &[SubscriptionCursorWithoutToken],
flow_id: T
) -> ApiFuture<()>
[src]
&self,
id: SubscriptionId,
cursors: &[SubscriptionCursorWithoutToken],
flow_id: T
) -> ApiFuture<()>
Reset subscription offsets to specified values.
See also Nakadi Manual
impl SubscriptionCommitApi for ApiClient
[src]
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]
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[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,
fn reset_cursors_to_begin<T>(
&Self,
SubscriptionId,
T
) -> Pin<Box<dyn Future<Output = Result<(), NakadiApiError>> + Send>> where
T: Into<FlowId>,
[src]
&Self,
SubscriptionId,
T
) -> Pin<Box<dyn Future<Output = Result<(), NakadiApiError>> + Send>> 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.
fn to_owned(&self) -> T
[src]
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.
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.
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>,