pub struct StreamOptions { /* private fields */ }Expand description
Options of a stream: takeover and hooks. Hooks run on the stream’s task; a panic in a
hook is caught and logged and never ends the stream.
Implementations§
Source§impl StreamOptions
impl StreamOptions
Sourcepub fn takeover(self, value: bool) -> Self
pub fn takeover(self, value: bool) -> Self
Send x-takeover: true: at the connection limit, replace your stalest connection.
Default off.
Sourcepub fn on_admitted(
self,
hook: impl Fn(&AdmittedInfo) + Send + Sync + 'static,
) -> Self
pub fn on_admitted( self, hook: impl Fn(&AdmittedInfo) + Send + Sync + 'static, ) -> Self
Called for every connection.admitted.
Sourcepub fn on_reconnect(
self,
hook: impl Fn(&ReconnectInfo) + Send + Sync + 'static,
) -> Self
pub fn on_reconnect( self, hook: impl Fn(&ReconnectInfo) + Send + Sync + 'static, ) -> Self
Called after every new connection except the first one.
Sourcepub fn on_error(self, hook: impl Fn(&Error) + Send + Sync + 'static) -> Self
pub fn on_error(self, hook: impl Fn(&Error) + Send + Sync + 'static) -> Self
Called for problems that do not end the stream.
Sourcepub fn on_quota_wait(
self,
hook: impl Fn(&QuotaWaitInfo) + Send + Sync + 'static,
) -> Self
pub fn on_quota_wait( self, hook: impl Fn(&QuotaWaitInfo) + Send + Sync + 'static, ) -> Self
Called for every wait for the WebSocket quota (see Config::quota_reconnect).
Trait Implementations§
Source§impl Clone for StreamOptions
impl Clone for StreamOptions
Source§impl Debug for StreamOptions
impl Debug for StreamOptions
Auto Trait Implementations§
impl !RefUnwindSafe for StreamOptions
impl !UnwindSafe for StreamOptions
impl Forget for StreamOptions
impl Freeze for StreamOptionswhere
*const ArcInner<dyn Fn(&AdmittedInfo) + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&AdmittedInfo) + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(&ReconnectInfo) + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&ReconnectInfo) + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(&Error) + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&Error) + Sync + Send>>: Freeze,
*const ArcInner<dyn Fn(&QuotaWaitInfo) + Sync + Send> is !null: Freeze,
PhantomData<ArcInner<dyn Fn(&QuotaWaitInfo) + Sync + Send>>: Freeze,
impl Move for StreamOptions
impl Send for StreamOptions
impl Sync for StreamOptions
impl Unpin for StreamOptions
impl UnsafeUnpin for StreamOptionswhere
*const ArcInner<dyn Fn(&AdmittedInfo) + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&AdmittedInfo) + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&ReconnectInfo) + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&ReconnectInfo) + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&Error) + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&Error) + Sync + Send>>: UnsafeUnpin,
*const ArcInner<dyn Fn(&QuotaWaitInfo) + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(&QuotaWaitInfo) + Sync + Send>>: UnsafeUnpin,
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