pub struct PubsubClientWithReconnect {
pub client: ArcSwap<PubsubClient>,
pub rpc_url_ws: String,
pub reconnect_lock: Mutex<()>,
}Fields§
§client: ArcSwap<PubsubClient>§rpc_url_ws: String§reconnect_lock: Mutex<()>Mutex to prevent redundant concurrent reconnections
Implementations§
Source§impl PubsubClientWithReconnect
impl PubsubClientWithReconnect
pub fn new(rpc_url_ws: String, client: PubsubClient) -> Self
Sourcepub async fn reconnect_pubsub(&self) -> Result<(), (StatusCode, String)>
pub async fn reconnect_pubsub(&self) -> Result<(), (StatusCode, String)>
Reconnects the PubsubClient after grabbing a lock which prevents concurrent reconnections.
Auto Trait Implementations§
impl !Freeze for PubsubClientWithReconnect
impl !RefUnwindSafe for PubsubClientWithReconnect
impl !UnwindSafe for PubsubClientWithReconnect
impl Forget for PubsubClientWithReconnect
impl Send for PubsubClientWithReconnect
impl Sync for PubsubClientWithReconnect
impl Unpin for PubsubClientWithReconnect
impl UnsafeUnpin for PubsubClientWithReconnect
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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