Struct Global Copy item path Source pub struct Global<T, R = T> { }
Expand description A lazy value that is created once per application and can be accessed from anywhere in that application
Get the generational id of the signal.
Resolve the global memo. This will try to get the existing value from the current virtual dom, and if it doesn’t exist, it will create a new one.
Get the generational id of the signal.
Resolve the global signal. This will try to get the existing value from the current virtual dom, and if it doesn’t exist, it will create a new one.
Run a closure with a mutable reference to the signal’s value.
If the signal has been dropped, this will panic.
Create a new global value
Create this global signal with a specific key.
This is useful for ensuring that the signal is unique across the application and accessible from
outside the application too.
Create this global signal with a specific key.
This is useful for ensuring that the signal is unique across the application and accessible from
outside the application too.
Get the key for this global
Resolve the global value. This will try to get the existing value from the current virtual dom, and if it doesn’t exist, it will create a new one.
Get the scope the signal was created in.
Source § Allow calling a signal with signal() syntax
Currently only limited to copy types, though could probably specialize for string/arc/rc
The resulting type after dereferencing.
Dereferences the value.
The target type of the reference.
The type of the storage this readable uses.
Try to get a reference to the value without checking the lifetime. This will subscribe the current scope to the signal.
Read more Try to peek the current value of the signal without subscribing to updates. If the value has
been dropped, this will return an error.
Read more Get the current value of the state. If this is a signal, this will subscribe the current scope to the signal.
If the value has been dropped, this will panic. Calling this on a Signal is the same as
using the signal() syntax to read and subscribe to its value
Try to get the current value of the state. If this is a signal, this will subscribe the current scope to the signal.
Get a reference to the value without checking the lifetime. This will subscribe the current scope to the signal.
Read more Get the current value of the state without subscribing to updates. If the value has been dropped, this will panic.
Read more Try to peek the current value of the signal without subscribing to updates. If the value has
been dropped, this will return an error.
Get the current value of the signal without checking the lifetime.
Unlike read, this will not subscribe the current scope to the signal which can cause parts of your UI to not update. Read more Clone the inner value and return it. If the value has been dropped, this will panic.
Run a function with a reference to the value. If the value has been dropped, this will panic.
Run a function with a reference to the value. If the value has been dropped, this will panic.
Index into the inner value and return a reference to the result. If the value has been dropped or the index is invalid, this will panic.
The type of the reference.
Map the reference to a new type.
Try to map the reference to a new type.
Downcast a mutable reference in a RefMut to a more specific lifetime
Read more Try to get a mutable reference to the value without checking the lifetime. This will update any subscribers.
Read more Get a mutable reference to the value. If the value has been dropped, this will panic.
Try to get a mutable reference to the value.
Get a mutable reference to the value without checking the lifetime. This will update any subscribers.
Read more Run a function with a mutable reference to the value. If the value has been dropped, this will panic.
Set the value of the signal. This will trigger an update on all subscribers.
Invert the boolean value of the signal. This will trigger an update on all subscribers.
Index into the inner value and return a reference to the result.
Takes the value out of the Signal, leaving a Default in its place.
Replace the value in the Signal, returning the old value.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more Returns the argument unchanged.
Create an instance of this type from an initialization function
Instruments this type with the provided
Span
, returning an
Instrumented
wrapper.
Read more Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From <T> for U
chooses to do.
Unwraps the inner value and clones it.
Attempts to read the inner value of the Option.
Unwraps the inner value and clones it.
Attempts to read the inner value of the Option.
Returns the length of the inner vector.
Returns true if the inner vector is empty.
Get the first element of the inner vector.
Get the last element of the inner vector.
Get the element at the given index of the inner vector.
Get an iterator over the values of the inner vector.
🔬 This is a nightly-only experimental API. (arbitrary_self_types
)
The target type on which the method may be called.
Spawn the value into the dioxus runtime if it is an async block
Convert from a type to another type.
Convert from a type to another type.
Converts the given value to a
String
.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Gets the value out of the Option, or inserts the given value if the Option is empty.
Gets the value out of the Option, or inserts the value returned by the given function if the Option is empty.
Attempts to write the inner value of the Option.
Pushes a new value to the end of the vector.
Pops the last value from the vector.
Inserts a new value at the given index.
Removes the value at the given index.
Clears the vector, removing all values.
Extends the vector with the given iterator.
Truncates the vector to the given length.
Swaps two values in the vector.
Retains only the values that match the given predicate.
Splits the vector into two at the given index.
Try to mutably get an element from the vector.
Gets an iterator over the values of the vector.