Struct merino_integration_tests::utils::redis::AVAILABLE_DATABASES
source · [−]struct AVAILABLE_DATABASES {
__private_field: (),
}
Fields
__private_field: ()
Methods from Deref<Target = OnceCell<Pool<i64>>>
sourcepub fn initialized(&self) -> bool
pub fn initialized(&self) -> bool
Returns true
if the OnceCell
currently contains a value, and false
otherwise.
sourcepub fn get(&self) -> Option<&T>
pub fn get(&self) -> Option<&T>
Returns a reference to the value currently stored in the OnceCell
, or
None
if the OnceCell
is empty.
sourcepub fn set(&self, value: T) -> Result<(), SetError<T>>
pub fn set(&self, value: T) -> Result<(), SetError<T>>
Sets the value of the OnceCell
to the given value if the OnceCell
is
empty.
If the OnceCell
already has a value, this call will fail with an
SetError::AlreadyInitializedError
.
If the OnceCell
is empty, but some other task is currently trying to
set the value, this call will fail with SetError::InitializingError
.
sourcepub async fn get_or_init<F, Fut>(&self, f: F) -> &T where
F: FnOnce() -> Fut,
Fut: Future<Output = T>,
pub async fn get_or_init<F, Fut>(&self, f: F) -> &T where
F: FnOnce() -> Fut,
Fut: Future<Output = T>,
Gets the value currently in the OnceCell
, or initialize it with the
given asynchronous operation.
If some other task is currently working on initializing the OnceCell
,
this call will wait for that other task to finish, then return the value
that the other task produced.
If the provided operation is cancelled or panics, the initialization attempt is cancelled. If there are other tasks waiting for the value to be initialized, one of them will start another attempt at initializing the value.
This will deadlock if f
tries to initialize the cell recursively.
sourcepub async fn get_or_try_init<E, F, Fut>(&self, f: F) -> Result<&T, E> where
F: FnOnce() -> Fut,
Fut: Future<Output = Result<T, E>>,
pub async fn get_or_try_init<E, F, Fut>(&self, f: F) -> Result<&T, E> where
F: FnOnce() -> Fut,
Fut: Future<Output = Result<T, E>>,
Gets the value currently in the OnceCell
, or initialize it with the
given asynchronous operation.
If some other task is currently working on initializing the OnceCell
,
this call will wait for that other task to finish, then return the value
that the other task produced.
If the provided operation returns an error, is cancelled or panics, the initialization attempt is cancelled. If there are other tasks waiting for the value to be initialized, one of them will start another attempt at initializing the value.
This will deadlock if f
tries to initialize the cell recursively.
Trait Implementations
sourceimpl Deref for AVAILABLE_DATABASES
impl Deref for AVAILABLE_DATABASES
impl LazyStatic for AVAILABLE_DATABASES
Auto Trait Implementations
impl RefUnwindSafe for AVAILABLE_DATABASES
impl Send for AVAILABLE_DATABASES
impl Sync for AVAILABLE_DATABASES
impl Unpin for AVAILABLE_DATABASES
impl UnwindSafe for AVAILABLE_DATABASES
Blanket Implementations
sourceimpl<'a, T, E> AsTaggedExplicit<'a, E> for T where
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for T where
T: 'a,
sourceimpl<'a, T, E> AsTaggedImplicit<'a, E> for T where
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for T where
T: 'a,
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more