Struct actix_web_lab::extract::SwapData
source · pub struct SwapData<T> { /* private fields */ }
Expand description
A wrapper around ArcSwap
that can be used as an extractor.
Can serve as a replacement for Data<RwLock<T>>
in certain situations.
Currently exposes some internals of arc-swap
and may change in the future.
Implementations§
Trait Implementations§
source§impl<T: 'static> FromRequest for SwapData<T>
impl<T: 'static> FromRequest for SwapData<T>
§type Future = Ready<Result<SwapData<T>, <SwapData<T> as FromRequest>::Error>>
type Future = Ready<Result<SwapData<T>, <SwapData<T> as FromRequest>::Error>>
Future that resolves to a
Self
. Read moresource§fn from_request(req: &HttpRequest, _pl: &mut Payload) -> Self::Future
fn from_request(req: &HttpRequest, _pl: &mut Payload) -> Self::Future
Create a
Self
from request parts asynchronously.Auto Trait Implementations§
impl<T> Freeze for SwapData<T>
impl<T> RefUnwindSafe for SwapData<T>where
T: RefUnwindSafe,
impl<T> Send for SwapData<T>
impl<T> Sync for SwapData<T>
impl<T> Unpin for SwapData<T>
impl<T> UnwindSafe for SwapData<T>where
T: RefUnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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