pub struct ReadHalf<T>where
T: Clone,{ /* private fields */ }
Expand description
The read half of an ObservableValue
, which can only listen for
updates and read the current value.
Implementations§
Source§impl<T> ReadHalf<T>where
T: Clone,
impl<T> ReadHalf<T>where
T: Clone,
Sourcepub fn connect<F>(&mut self, callback: F) -> SubscriptionId
pub fn connect<F>(&mut self, callback: F) -> SubscriptionId
Connect a new subscriber that will receive callbacks when the value is set.
Returns a SubscriptionId to disconnect the subscription when no longer required.
Sourcepub fn disconnect(&mut self, sub_id: SubscriptionId)
pub fn disconnect(&mut self, sub_id: SubscriptionId)
Disconnect an existing subscription.
Auto Trait Implementations§
impl<T> Freeze for ReadHalf<T>
impl<T> !RefUnwindSafe for ReadHalf<T>
impl<T> !Send for ReadHalf<T>
impl<T> !Sync for ReadHalf<T>
impl<T> Unpin for ReadHalf<T>
impl<T> !UnwindSafe for ReadHalf<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