pub enum Subscription {
Tcp(SubscriptionStream),
Ws(WebSocketSubscriptionStream),
}Expand description
One channel subscription on the seat’s transport.
Variants§
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn open(
address: &str,
channel: &str,
credential: &[u8],
) -> Result<Self, SdkError>
pub fn open( address: &str, channel: &str, credential: &[u8], ) -> Result<Self, SdkError>
Subscribes to channel at address carrying credential.
§Errors
The SDK’s refusal of the dial, the pass or the subscribe.
Sourcepub fn recv(&self) -> Result<DeliveredMessage, SdkError>
pub fn recv(&self) -> Result<DeliveredMessage, SdkError>
Blocks on a delivery or the subscription’s end, without a timer.
§Errors
The server’s terminal, a reader failure or a local close.
Sourcepub fn recv_timeout(
&self,
timeout: Duration,
) -> Result<DeliveredMessage, SdkError>
pub fn recv_timeout( &self, timeout: Duration, ) -> Result<DeliveredMessage, SdkError>
Blocks up to timeout for the next delivery.
§Errors
No delivery within timeout, or the subscription’s end.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Subscription
impl !UnwindSafe for Subscription
impl Freeze for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl UnsafeUnpin for Subscription
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.