pub struct Loader<T>where
T: 'static,{ /* private fields */ }Expand description
A Loader is a signal that represents a value that is loaded asynchronously.
Once a Loader<T> has been successfully created from use_loader, it can be use like a normal signal of type T.
When the loader is re-reloading its values, it will no longer suspend its component, making it very useful for server-side-rendering.
Implementations§
Source§impl<T> Loader<T>where
T: 'static,
impl<T> Loader<T>where
T: 'static,
Sourcepub fn error(&self) -> Option<CapturedError>
pub fn error(&self) -> Option<CapturedError>
Get the error that occurred during loading, if any.
After initial load, this will return None until the next reload fails.
Sourcepub fn restart(&mut self)
pub fn restart(&mut self)
Restart the loading task.
After initial load, this won’t suspend the component, but will reload in the background.
pub fn loading(&self) -> bool
Trait Implementations§
Source§impl<T> IntoAttributeValue for Loader<T>
impl<T> IntoAttributeValue for Loader<T>
Source§fn into_value(self) -> AttributeValue
fn into_value(self) -> AttributeValue
Source§impl<T> IntoDynNode for Loader<T>
impl<T> IntoDynNode for Loader<T>
Source§fn into_dyn_node(self) -> DynamicNode
fn into_dyn_node(self) -> DynamicNode
Source§impl<T> Readable for Loader<T>
impl<T> Readable for Loader<T>
Source§fn try_peek_unchecked(
&self,
) -> Result<<<Loader<T> as Readable>::Storage as AnyStorage>::Ref<'static, <Loader<T> as Readable>::Target>, BorrowError>where
T: 'static,
fn try_peek_unchecked(
&self,
) -> Result<<<Loader<T> as Readable>::Storage as AnyStorage>::Ref<'static, <Loader<T> as Readable>::Target>, BorrowError>where
T: 'static,
Get the current value of the signal. Unlike read, this will not subscribe the current scope to the signal which can cause parts of your UI to not update.
If the signal has been dropped, this will panic.
Source§type Storage = UnsyncStorage
type Storage = UnsyncStorage
Source§fn try_read_unchecked(
&self,
) -> Result<<<Loader<T> as Readable>::Storage as AnyStorage>::Ref<'static, <Loader<T> as Readable>::Target>, BorrowError>where
T: 'static,
fn try_read_unchecked(
&self,
) -> Result<<<Loader<T> as Readable>::Storage as AnyStorage>::Ref<'static, <Loader<T> as Readable>::Target>, BorrowError>where
T: 'static,
Source§fn subscribers(&self) -> Subscriberswhere
T: 'static,
fn subscribers(&self) -> Subscriberswhere
T: 'static,
Source§impl<T> Writable for Loader<T>where
T: 'static,
impl<T> Writable for Loader<T>where
T: 'static,
Source§type WriteMetadata = <Signal<Option<T>> as Writable>::WriteMetadata
type WriteMetadata = <Signal<Option<T>> as Writable>::WriteMetadata
Source§fn try_write_unchecked(
&self,
) -> Result<WriteLock<'static, <Loader<T> as Readable>::Target, <Loader<T> as Readable>::Storage, <Loader<T> as Writable>::WriteMetadata>, BorrowMutError>
fn try_write_unchecked( &self, ) -> Result<WriteLock<'static, <Loader<T> as Readable>::Target, <Loader<T> as Readable>::Storage, <Loader<T> as Writable>::WriteMetadata>, BorrowMutError>
impl<T> Copy for Loader<T>
Auto Trait Implementations§
impl<T> Freeze for Loader<T>
impl<T> !RefUnwindSafe for Loader<T>
impl<T> !Send for Loader<T>
impl<T> !Sync for Loader<T>
impl<T> Unpin for Loader<T>where
T: Unpin,
impl<T> !UnwindSafe for Loader<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R> ReadableBoxExt for R
impl<R> ReadableBoxExt for R
Source§impl<R> ReadableExt for R
impl<R> ReadableExt for R
Source§fn read(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>where
Self::Target: 'static,
fn read(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>where
Self::Target: 'static,
Source§fn try_read(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, Self::Target>, BorrowError>where
Self::Target: 'static,
fn try_read(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, Self::Target>, BorrowError>where
Self::Target: 'static,
Source§fn read_unchecked(
&self,
) -> <Self::Storage as AnyStorage>::Ref<'static, Self::Target>where
Self::Target: 'static,
fn read_unchecked(
&self,
) -> <Self::Storage as AnyStorage>::Ref<'static, Self::Target>where
Self::Target: 'static,
Source§fn peek(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>where
Self::Target: 'static,
fn peek(&self) -> <Self::Storage as AnyStorage>::Ref<'_, Self::Target>where
Self::Target: 'static,
Source§fn try_peek(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, Self::Target>, BorrowError>where
Self::Target: 'static,
fn try_peek(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, Self::Target>, BorrowError>where
Self::Target: 'static,
Source§fn peek_unchecked(
&self,
) -> <Self::Storage as AnyStorage>::Ref<'static, Self::Target>where
Self::Target: 'static,
fn peek_unchecked(
&self,
) -> <Self::Storage as AnyStorage>::Ref<'static, Self::Target>where
Self::Target: 'static,
Source§fn map<F, O>(self, f: F) -> MappedSignal<O, Self, F>
fn map<F, O>(self, f: F) -> MappedSignal<O, Self, F>
Source§fn cloned(&self) -> Self::Target
fn cloned(&self) -> Self::Target
Source§fn with<O>(&self, f: impl FnOnce(&Self::Target) -> O) -> Owhere
Self::Target: 'static,
fn with<O>(&self, f: impl FnOnce(&Self::Target) -> O) -> Owhere
Self::Target: 'static,
Source§impl<K, V, H, R> ReadableHashMapExt<K, V, H> for R
impl<K, V, H, R> ReadableHashMapExt<K, V, H> for R
Source§impl<V, H, R> ReadableHashSetExt<V, H> for R
impl<V, H, R> ReadableHashSetExt<V, H> for R
Source§impl<T, R> ReadableOptionExt<T> for R
impl<T, R> ReadableOptionExt<T> for R
Source§impl<T, E, R> ReadableResultExt<T, E> for R
impl<T, E, R> ReadableResultExt<T, E> for R
Source§fn unwrap(&self) -> Twhere
T: Clone + 'static,
E: 'static,
fn unwrap(&self) -> Twhere
T: Clone + 'static,
E: 'static,
Source§fn as_ref(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, T>, <Self::Storage as AnyStorage>::Ref<'_, E>>where
T: 'static,
E: 'static,
fn as_ref(
&self,
) -> Result<<Self::Storage as AnyStorage>::Ref<'_, T>, <Self::Storage as AnyStorage>::Ref<'_, E>>where
T: 'static,
E: 'static,
Source§impl<W> ReadableStringExt for W
impl<W> ReadableStringExt for W
Source§impl<T, R> ReadableVecExt<T> for R
impl<T, R> ReadableVecExt<T> for R
Source§fn first(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
fn first(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
Source§fn last(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
fn last(&self) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
Source§fn get(&self, index: usize) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
fn get(&self, index: usize) -> Option<<Self::Storage as AnyStorage>::Ref<'_, T>>where
T: 'static,
Source§fn iter(&self) -> ReadableValueIterator<'_, Self>where
Self: Sized,
fn iter(&self) -> ReadableValueIterator<'_, Self>where
Self: Sized,
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.