pub struct Captured<T: Clone>(pub T);Expand description
Capture values to use later inside Queries or Mutations, but with a catch, if the capture value changes the mutation will not recapture it because
the PartialEq implementation always returns true.
So in other words Capture(1) == Capture(5) will be true.
This is intended to use for value types that are not mean to be diffed and that are expected to maintain their value across time. Like “Clients” of external resources such as API Clients.
Just so its clear, you might or not need this, use carefully.
Tuple Fields§
§0: TTrait Implementations§
impl<T: Clone> Eq for Captured<T>
Auto Trait Implementations§
impl<T> Freeze for Captured<T>where
T: Freeze,
impl<T> RefUnwindSafe for Captured<T>where
T: RefUnwindSafe,
impl<T> Send for Captured<T>where
T: Send,
impl<T> Sync for Captured<T>where
T: Sync,
impl<T> Unpin for Captured<T>where
T: Unpin,
impl<T> UnwindSafe for Captured<T>where
T: UnwindSafe,
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,
§impl<T> ComponentProps for T
impl<T> ComponentProps for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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