You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I am using Leptos to manage large objects, including WebGPU objects that cannot be cloned. I would wrap the object in a signal, do some reactive operations with it, and would subsequently like to get the object back.
A very similar case came up while I was trying to implement a pop method for struct SignalVec<T> { ArcRwSignal<Vec<ArcRwSignal<T>>> } . See #3066
Describe the solution you'd like
I'd love it if there were a function analogous to the standard library RwLock/Arc::into_inner.
// for the ArcRwSignal/// Returns the inner value if this is the only reference to to the signal./// Otherwise, returns `None`./// # Panics/// Panics if the inner lock is poisoned.#[track_caller]pubfninto_inner(self) -> Option<T>{// I believe the subscribers don't matter here, because they aren't holding a reference to the value.Arc::into_inner(self.value)?.into_inner().ok()}
Describe alternatives you've considered
Using clunky workarounds, such as wrapping my objects into Options, and taking the values out of the options.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I am using Leptos to manage large objects, including WebGPU objects that cannot be cloned. I would wrap the object in a signal, do some reactive operations with it, and would subsequently like to get the object back.
A very similar case came up while I was trying to implement a
pop
method forstruct SignalVec<T> { ArcRwSignal<Vec<ArcRwSignal<T>>> }
. See #3066Describe the solution you'd like
I'd love it if there were a function analogous to the standard library
RwLock/Arc::into_inner
.Describe alternatives you've considered
Using clunky workarounds, such as wrapping my objects into
Option
s, and taking the values out of the options.The text was updated successfully, but these errors were encountered: