Struct agde_io::StateHandle
source · pub struct StateHandle<P: Platform> {
pub manager: Arc<Mutex<Manager>>,
pub options: Arc<Options<P>>,
pub platform: PlatformExt<P>,
/* private fields */
}
Fields§
§manager: Arc<Mutex<Manager>>
§options: Arc<Options<P>>
§platform: PlatformExt<P>
Implementations§
source§impl<P: Platform> StateHandle<P>
impl<P: Platform> StateHandle<P>
sourcepub async fn commit_and_send(
&self,
cursors: &mut [Cursor<'_>]
) -> Result<(), ApplicationError>
pub async fn commit_and_send( &self, cursors: &mut [Cursor<'_>] ) -> Result<(), ApplicationError>
Commit and send our changes.
This also pulls the changes from others to the current
storage.
The cursors
are a list of byte-index positions in the resources where you have cursors
(read: text-editing cursors). After calling this function, their Cursor::index
are
modified according to the changes from your piers. This means your user’s cursor changes
position when pulling changes, to the logically same place, even if edits happened above in
the document.
sourcepub fn abort_tasks(&self)
pub fn abort_tasks(&self)
Abort all running tasks set up by agde.
This disabled listening for new messages, committing our changes, resolving the fast forward, and periodic events such as flushing and log checks.
Use this when implementing shutdown.