pub struct CursorRestore { /* private fields */ }Expand description
Cursor Restore Manager
Implementations§
Source§impl CursorRestore
impl CursorRestore
Sourcepub fn with_max_cursors(self, max: usize) -> Self
pub fn with_max_cursors(self, max: usize) -> Self
Configure max cursors per session
Sourcepub fn with_backend_template(self, template: BackendConfig) -> Self
pub fn with_backend_template(self, template: BackendConfig) -> Self
Attach a backend-connection template so real cursor recreation
can run DECLARE / MOVE against the target node.
Sourcepub async fn register_endpoint(&self, node_id: NodeId, endpoint: NodeEndpoint)
pub async fn register_endpoint(&self, node_id: NodeId, endpoint: NodeEndpoint)
Register an endpoint for a node so restore can resolve where to re-declare the cursor.
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable cursor restore
Sourcepub async fn save_cursor(&self, state: CursorState) -> Result<()>
pub async fn save_cursor(&self, state: CursorState) -> Result<()>
Save cursor state
Sourcepub async fn update_position(
&self,
cursor_name: &str,
new_position: u64,
) -> Result<()>
pub async fn update_position( &self, cursor_name: &str, new_position: u64, ) -> Result<()>
Update cursor position
Sourcepub async fn close_cursor(&self, cursor_name: &str) -> Result<()>
pub async fn close_cursor(&self, cursor_name: &str) -> Result<()>
Close a cursor
Sourcepub async fn get_cursor(&self, cursor_name: &str) -> Option<CursorState>
pub async fn get_cursor(&self, cursor_name: &str) -> Option<CursorState>
Get cursor state
Sourcepub async fn get_session_cursors(&self, session_id: &Uuid) -> Vec<CursorState>
pub async fn get_session_cursors(&self, session_id: &Uuid) -> Vec<CursorState>
Get all cursors for a session
Sourcepub async fn restore_cursor(
&self,
cursor_name: &str,
target_node: NodeId,
) -> Result<CursorRestoreResult>
pub async fn restore_cursor( &self, cursor_name: &str, target_node: NodeId, ) -> Result<CursorRestoreResult>
Restore a cursor on a new node
Sourcepub async fn restore_session_cursors(
&self,
session_id: &Uuid,
target_node: NodeId,
) -> Vec<CursorRestoreResult>
pub async fn restore_session_cursors( &self, session_id: &Uuid, target_node: NodeId, ) -> Vec<CursorRestoreResult>
Restore all cursors for a session
Sourcepub async fn clear_session(&self, session_id: &Uuid)
pub async fn clear_session(&self, session_id: &Uuid)
Clear all cursors for a session
Sourcepub async fn stats(&self) -> CursorRestoreStats
pub async fn stats(&self) -> CursorRestoreStats
Get statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CursorRestore
impl !RefUnwindSafe for CursorRestore
impl Send for CursorRestore
impl Sync for CursorRestore
impl Unpin for CursorRestore
impl UnsafeUnpin for CursorRestore
impl !UnwindSafe for CursorRestore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more