pub struct LazyChromeFailover { /* private fields */ }chrome only.Expand description
Lazy, lock-free, leak-free holder for a ChromeConnectionFailover.
Constructed lazily on first call to get_or_init, then reused across
every subsequent setup_browser_configuration invocation. After init,
access is a single atomic load — no parking, no awaits, no mutexes.
Reset (via with_chrome_connections) replaces the cell with a fresh
empty one; the previous Arc<ChromeConnectionFailover> drops cleanly
once the last in-flight reader releases it.
Implementations§
Source§impl LazyChromeFailover
impl LazyChromeFailover
Sourcepub fn get_or_init(
&self,
urls: &[String],
max_retries: u32,
) -> &Arc<ChromeConnectionFailover> ⓘ
pub fn get_or_init( &self, urls: &[String], max_retries: u32, ) -> &Arc<ChromeConnectionFailover> ⓘ
Borrow the failover, lazily initializing it on first call. The closure runs exactly once for the lifetime of this cell.
Sourcepub fn mark_url_bad(&self, url: &str, cooldown_millis: u64)
pub fn mark_url_bad(&self, url: &str, cooldown_millis: u64)
Mark a URL as dead on the inner failover (no-op if the cell hasn’t been initialized yet, or the URL isn’t part of the failover list). Lock-free: a single atomic store on the matching slot.
Sourcepub fn last_connected_url(&self) -> Option<&str>
pub fn last_connected_url(&self) -> Option<&str>
Borrowed URL of the most recently-successful endpoint, or None
when the cell hasn’t initialized or no successful connect has
happened yet. Lock-free: one atomic load + one slice lookup.
Trait Implementations§
Source§impl Clone for LazyChromeFailover
impl Clone for LazyChromeFailover
Source§impl Debug for LazyChromeFailover
impl Debug for LazyChromeFailover
Source§impl Default for LazyChromeFailover
impl Default for LazyChromeFailover
Source§fn default() -> LazyChromeFailover
fn default() -> LazyChromeFailover
Source§impl PartialEq for LazyChromeFailover
impl PartialEq for LazyChromeFailover
Auto Trait Implementations§
impl Freeze for LazyChromeFailover
impl RefUnwindSafe for LazyChromeFailover
impl Send for LazyChromeFailover
impl Sync for LazyChromeFailover
impl Unpin for LazyChromeFailover
impl UnsafeUnpin for LazyChromeFailover
impl UnwindSafe for LazyChromeFailover
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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