pub struct ArcLocalSignal<T: 'static>(/* private fields */);
Expand description
A local variant of an ArcSignal
, that will panic if accessed from a different thread.
Used for the [QueryClient::subscribe_value_arc_local
] return type.
Implementations§
Source§impl<T> ArcLocalSignal<T>
impl<T> ArcLocalSignal<T>
Sourcepub fn derive_local(derive_fn: impl Fn() -> T + 'static) -> Self
pub fn derive_local(derive_fn: impl Fn() -> T + 'static) -> Self
Like ArcSignal::derive
, but the value is not threadsafe and will panic if accessed from a different thread.
Trait Implementations§
Source§impl<T> Clone for ArcLocalSignal<T>
impl<T> Clone for ArcLocalSignal<T>
Source§impl<T> Debug for ArcLocalSignal<T>where
T: Debug + 'static,
impl<T> Debug for ArcLocalSignal<T>where
T: Debug + 'static,
Source§impl<T> DefinedAt for ArcLocalSignal<T>
impl<T> DefinedAt for ArcLocalSignal<T>
Source§fn defined_at(&self) -> Option<&'static Location<'static>>
fn defined_at(&self) -> Option<&'static Location<'static>>
Returns the location at which the signal was defined. This is usually simply
None
in
release mode.Source§impl<T: Clone> From<ArcLocalSignal<T>> for Signal<T, LocalStorage>
impl<T: Clone> From<ArcLocalSignal<T>> for Signal<T, LocalStorage>
Source§fn from(value: ArcLocalSignal<T>) -> Self
fn from(value: ArcLocalSignal<T>) -> Self
Converts to this type from the input type.
Source§impl<T> ReadUntracked for ArcLocalSignal<T>
impl<T> ReadUntracked for ArcLocalSignal<T>
Source§type Value = ReadGuard<T, Mapped<<ArcSignal<SendWrapper<T>> as ReadUntracked>::Value, T>>
type Value = ReadGuard<T, Mapped<<ArcSignal<SendWrapper<T>> as ReadUntracked>::Value, T>>
The guard type that will be returned, which can be dereferenced to the value.
Source§fn try_read_untracked(&self) -> Option<Self::Value>
fn try_read_untracked(&self) -> Option<Self::Value>
Returns the guard, or
None
if the signal has already been disposed.Source§fn read_untracked(&self) -> Self::Value
fn read_untracked(&self) -> Self::Value
Returns the guard. Read more
Source§fn custom_try_read(&self) -> Option<Option<Self::Value>>
fn custom_try_read(&self) -> Option<Option<Self::Value>>
This is a backdoor to allow overriding the
Read::try_read
implementation despite it being auto implemented. Read moreAuto Trait Implementations§
impl<T> Freeze for ArcLocalSignal<T>
impl<T> !RefUnwindSafe for ArcLocalSignal<T>
impl<T> Send for ArcLocalSignal<T>
impl<T> Sync for ArcLocalSignal<T>
impl<T> Unpin for ArcLocalSignal<T>
impl<T> !UnwindSafe for ArcLocalSignal<T>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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§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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out
indicating that a T
is niched.Source§impl<T> Read for Twhere
T: Track + ReadUntracked,
impl<T> Read for Twhere
T: Track + ReadUntracked,
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.
Source§impl<T> With for Twhere
T: Read,
impl<T> With for Twhere
T: Read,
Source§type Value = <<T as Read>::Value as Deref>::Target
type Value = <<T as Read>::Value as Deref>::Target
The type of the value contained in the signal.
Source§impl<T> WithUntracked for Twhere
T: DefinedAt + ReadUntracked,
impl<T> WithUntracked for Twhere
T: DefinedAt + ReadUntracked,
Source§type Value = <<T as ReadUntracked>::Value as Deref>::Target
type Value = <<T as ReadUntracked>::Value as Deref>::Target
The type of the value contained in the signal.
Source§fn try_with_untracked<U>(
&self,
fun: impl FnOnce(&<T as WithUntracked>::Value) -> U,
) -> Option<U>
fn try_with_untracked<U>( &self, fun: impl FnOnce(&<T as WithUntracked>::Value) -> U, ) -> Option<U>
Applies the closure to the value, and returns the result,
or
None
if the signal has already been disposed.