pub trait ReadUntracked: Sized + DefinedAt {
type Value: Deref;
// Required method
fn try_read_untracked(&self) -> Option<Self::Value>;
// Provided methods
fn read_untracked(&self) -> Self::Value { ... }
fn custom_try_read(&self) -> Option<Option<Self::Value>> { ... }
}
Expand description
Give read-only access to a signal’s value by reference through a guard type, without tracking the value reactively.
Required Associated Types§
Required Methods§
Sourcefn 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.
Provided Methods§
Sourcefn read_untracked(&self) -> Self::Value
fn read_untracked(&self) -> Self::Value
Sourcefn 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.
If your type contains a Signal
,
call it’s ReadUntracked::custom_try_read
here, else return None
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.