[][src]Struct nakadion::components::connector::Connector

pub struct Connector<C> { /* fields omitted */ }

A Connector to connect to a Nakadi Stream

Usage

If other than default values should be used the Connector can be configured via its mutable methods.

Implementations

impl<C> Connector<C> where
    C: SubscriptionStreamApi + Send + Sync + 'static, 
[src]

pub fn new_with_config(stream_client: C, config: ConnectConfig) -> Self[src]

pub fn new(stream_client: C) -> Self[src]

pub async fn connect<'_>(
    &'_ self,
    subscription_id: SubscriptionId
) -> Result<SubscriptionStreamChunks, ConnectError>
[src]

Connect to Nakadi for a stream of byte chunks.

pub async fn connect_abortable<F, '_>(
    &'_ self,
    subscription_id: SubscriptionId,
    abort: F
) -> Result<SubscriptionStreamChunks, ConnectError> where
    F: FnMut() -> bool + Send
[src]

Connect to Nakadi for a stream of byte chunks.

A closure which is regularly polled must be provided for the connector to determine whether connecting to Nakadi shall be aborted.

pub fn set_logger<L: Logger>(&mut self, logger: L)[src]

Sets the logger to be used from now on.

The Logger is used mostly for emitting retry warnings.

pub fn logger<L: Logger>(self, logger: L) -> Self[src]

Sets the logger to be used from now on in a builder method style.

The Logger is used mostly for emitting retry warnings.

pub fn instrumentation(&self) -> Instrumentation[src]

Get the currently used instrumentation

pub fn set_flow_id(&mut self, flow_id: FlowId)[src]

Sets the FlowId for the next connect attempts.

If not set, a random FlowId will be generated.

pub fn configure(self, config: ConnectConfig) -> Self[src]

Set the ConnectConfig in a builder style

pub fn set_config(&mut self, config: ConnectConfig)[src]

Set the ConnectConfig which shall be used for the next connect attempt

pub fn config(&self) -> &ConnectConfig[src]

Returns a reference to the currently used config

pub fn config_mut(&mut self) -> &mut ConnectConfig[src]

Returns a mutable reference to the currently used config

pub fn set_instrumentation(&mut self, instrumentation: Instrumentation)[src]

Sets the Instrumentation to be used with this connector.

Uses the Instrumentation of the consumer since this is a component used by the Consumer itself.

pub fn stream_parameters_mut(&mut self) -> &mut StreamParameters[src]

Gets a mutable reference to the StreamParameters of the currently used ConnectConfig

pub async fn frame_stream<'_>(
    &'_ self,
    subscription_id: SubscriptionId
) -> Result<(StreamId, BoxedFrameStream), ConnectError>
[src]

Get a stream of frames(lines) directly from Nakadi.

pub async fn event_stream<'_>(
    &'_ self,
    subscription_id: SubscriptionId
) -> Result<(StreamId, BoxedEventStream), ConnectError>
[src]

Get a stream of analyzed (parsed) lines.

pub async fn events_stream<E: DeserializeOwned, '_>(
    &'_ self,
    subscription_id: SubscriptionId
) -> Result<(StreamId, BoxedParsedEventsStream<E>), ConnectError>
[src]

Get a stream of deserialized events.

Auto Trait Implementations

impl<C> !RefUnwindSafe for Connector<C>

impl<C> Send for Connector<C> where
    C: Send

impl<C> Sync for Connector<C> where
    C: Sync

impl<C> Unpin for Connector<C> where
    C: Unpin

impl<C> !UnwindSafe for Connector<C>

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, U> Into<U> for T where
    U: From<T>, 
[src]

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