mirror of
https://github.com/Zenithsiz/dynatos.git
synced 2026-02-08 21:09:52 +00:00
Loadable now implements SignalGetCopy.
This commit is contained in:
@@ -6,6 +6,8 @@ use std::{
|
||||
ops::{ControlFlow, FromResidual, Try},
|
||||
};
|
||||
|
||||
use dynatos_reactive::SignalGetCopy;
|
||||
|
||||
/// Loadable value.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub enum Loadable<T, E> {
|
||||
@@ -208,6 +210,12 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Copy, E> SignalGetCopy<Loadable<T, E>> for Loadable<&'_ T, E> {
|
||||
fn copy(self) -> Loadable<T, E> {
|
||||
self.map(|value| *value)
|
||||
}
|
||||
}
|
||||
|
||||
/// Extension trait for iterators of `Loadable<T, E>`
|
||||
#[extend::ext(name = IteratorLoadableExt)]
|
||||
pub impl<I, T, E> I
|
||||
|
||||
Reference in New Issue
Block a user