pub struct FieldCore<T> {
pub signal: Signal<T>,
pub rules: Arc<Mutex<Vec<DeclaredRule<T>>>>,
}Fields§
§signal: Signal<T>§rules: Arc<Mutex<Vec<DeclaredRule<T>>>>Implementations§
Source§impl<T: Clone + 'static> FieldCore<T>
impl<T: Clone + 'static> FieldCore<T>
pub fn new_with_signal(initial: Signal<T>) -> Self
pub fn new(initial: T) -> Self
Sourcepub fn rule<F>(&self, rule: F)
pub fn rule<F>(&self, rule: F)
Adds a rule every write goes through, for as long as the field lives: there is no handle to take it off.
Sourcepub fn ruled(&self, value: &mut T)
pub fn ruled(&self, value: &mut T)
Puts value through the declared rules, in the order they were added.
pub fn get(&self) -> T
pub fn subscribe<F>(&self, callback: F) -> SignalSubscription
pub fn subscribe_with_source<F>(&self, callback: F) -> SignalSubscription
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for FieldCore<T>
impl<T> RefUnwindSafe for FieldCore<T>
impl<T> Send for FieldCore<T>
impl<T> Sync for FieldCore<T>
impl<T> Unpin for FieldCore<T>
impl<T> UnsafeUnpin for FieldCore<T>
impl<T> UnwindSafe for FieldCore<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
Mutably borrows from an owned value. Read more