pub struct MirroredList<T> { /* private fields */ }Expand description
An append-only list that is mirroring an observable append-only list.
Clones of this are cheap and share the same underlying mirrored list.
Implementations§
Source§impl<T> MirroredList<T>where
T: RemoteSend + Clone,
impl<T> MirroredList<T>where
T: RemoteSend + Clone,
Sourcepub async fn borrow(&self) -> Result<MirroredListRef<'_, T>, RecvError>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub async fn borrow(&self) -> Result<MirroredListRef<'_, T>, RecvError>
Returns a reference to the current value of the list.
Updates are paused while the read lock is held.
This method returns an error if the observed list has been dropped or the connection to it failed before it was marked as done by calling ObservableList::done. In this case the mirrored contents at the point of loss of connection can be obtained using detach.
Sourcepub async fn borrow_and_update(
&mut self,
) -> Result<MirroredListRef<'_, T>, RecvError>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub async fn borrow_and_update( &mut self, ) -> Result<MirroredListRef<'_, T>, RecvError>
Returns a reference to the current value of the list and marks it as seen.
Thus changed will not return immediately until the value changes after this method returns.
Updates are paused while the read lock is held.
This method returns an error if the observed list has been dropped or the connection to it failed before it was marked as done by calling ObservableList::done. In this case the mirrored contents at the point of loss of connection can be obtained using detach.
Sourcepub async fn detach(self) -> Vec<T>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub async fn detach(self) -> Vec<T>
Stops updating the list and returns its current contents.
If clones of this mirrored list exist, the cloned contents are returned.
Sourcepub async fn changed(&mut self)
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub async fn changed(&mut self)
Waits for a change (append of one or more elements) and marks the newest value as seen.
This also returns when connection to the observed list has been lost or the list has been marked as done.
Sourcepub async fn done(&mut self) -> Result<(), RecvError>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub async fn done(&mut self) -> Result<(), RecvError>
Waits for the observed list to be marked as done and for all elements to be received by this mirror of it.
This marks changes as seen, even when aborted.
Trait Implementations§
Source§impl<T: Clone> Clone for MirroredList<T>
impl<T: Clone> Clone for MirroredList<T>
Source§fn clone(&self) -> MirroredList<T>
fn clone(&self) -> MirroredList<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more