pub struct StreamingApi<'a> { /* private fields */ }stream only.Expand description
Entry point for streaming. Obtain via crate::IgClient::streaming.
Implementations§
Source§impl StreamingApi<'_>
impl StreamingApi<'_>
Sourcepub async fn connect(
&self,
) -> Result<(StreamingClient, Receiver<StreamingEvent>)>
pub async fn connect( &self, ) -> Result<(StreamingClient, Receiver<StreamingEvent>)>
Connect to the Lightstreamer streaming endpoint with the default
AutoReconnect policy (enabled, 5 attempts, 1 s–30 s back-off).
The underlying session must already be authenticated before calling
this method. For a v3 (OAuth) session, call
client.session().read(true).await? first so that CST/XST tokens
are stored locally — Lightstreamer requires the
CST-<cst>|XST-<xst> password format regardless of auth flavour.
Returns (StreamingClient, Receiver<StreamingEvent>). The event
channel emits StreamingEvent::Reconnected,
StreamingEvent::ReconnectFailed, and
StreamingEvent::Disconnected lifecycle events.
Equivalent to connect_with(AutoReconnect::default()).
Sourcepub async fn connect_with(
&self,
policy: AutoReconnect,
) -> Result<(StreamingClient, Receiver<StreamingEvent>)>
pub async fn connect_with( &self, policy: AutoReconnect, ) -> Result<(StreamingClient, Receiver<StreamingEvent>)>
Connect with an explicit AutoReconnect policy.
Set policy.enabled = false to disable auto-reconnect and get the
pre-reconnect behaviour: the stream terminates on END and all
subscriber channels close.
Returns (StreamingClient, Receiver<StreamingEvent>).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for StreamingApi<'a>
impl<'a> !RefUnwindSafe for StreamingApi<'a>
impl<'a> Send for StreamingApi<'a>
impl<'a> Sync for StreamingApi<'a>
impl<'a> Unpin for StreamingApi<'a>
impl<'a> UnsafeUnpin for StreamingApi<'a>
impl<'a> !UnwindSafe for StreamingApi<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more