[−][src]Struct nakadion::components::connector::Connector
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]
C: SubscriptionStreamApi + Send + Sync + 'static,
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]
&'_ self,
subscription_id: SubscriptionId
) -> Result<SubscriptionStreamChunks, ConnectError>
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]
&'_ self,
subscription_id: SubscriptionId,
abort: F
) -> Result<SubscriptionStreamChunks, ConnectError> where
F: FnMut() -> bool + Send,
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]
&'_ self,
subscription_id: SubscriptionId
) -> Result<(StreamId, BoxedFrameStream), ConnectError>
Get a stream of frames(lines) directly from Nakadi.
pub async fn event_stream<'_>(
&'_ self,
subscription_id: SubscriptionId
) -> Result<(StreamId, BoxedEventStream), ConnectError>
[src]
&'_ self,
subscription_id: SubscriptionId
) -> Result<(StreamId, BoxedEventStream), ConnectError>
Get a stream of analyzed (parsed) lines.
pub async fn events_stream<E: DeserializeOwned, '_>(
&'_ self,
subscription_id: SubscriptionId
) -> Result<(StreamId, BoxedParsedEventsStream<E>), ConnectError>
[src]
&'_ self,
subscription_id: SubscriptionId
) -> Result<(StreamId, BoxedParsedEventsStream<E>), ConnectError>
Get a stream of deserialized events.
Auto Trait Implementations
impl<C> !RefUnwindSafe for Connector<C>
impl<C> Send for Connector<C> where
C: Send,
C: Send,
impl<C> Sync for Connector<C> where
C: Sync,
C: Sync,
impl<C> Unpin for Connector<C> where
C: Unpin,
C: Unpin,
impl<C> !UnwindSafe for Connector<C>
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, 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>,