pub struct Defrag {
pub defrag_ctx: *mut RedisModuleDefragCtx,
}Expand description
Defrag is a high-level rust interface to the Valkey module C API
abstracting away the raw C ffi calls.
Fields§
§defrag_ctx: *mut RedisModuleDefragCtxImplementations§
Source§impl Defrag
impl Defrag
pub const fn new(defrag_ctx: *mut RedisModuleDefragCtx) -> Self
Sourcepub unsafe fn set_cursor(&self, cursor: u64) -> Status
pub unsafe fn set_cursor(&self, cursor: u64) -> Status
§Sets a cursor on the last item defragged so that on the next defrag cycle, the Module can resume from that position using get_cursor.
§Should only be called if should_stop_defrag has returned true and the defrag callback is about to exit without fully iterating its data type.
§Panics
Will panic if RedisModule_DefragCursorSet is missing in redismodule.h
Sourcepub unsafe fn get_cursor(&self) -> Option<u64>
pub unsafe fn get_cursor(&self) -> Option<u64>
Sourcepub unsafe fn should_stop_defrag(&self) -> bool
pub unsafe fn should_stop_defrag(&self) -> bool
Sourcepub unsafe fn get_key_name_from_defrag_context(
&self,
) -> *const RedisModuleString
pub unsafe fn get_key_name_from_defrag_context( &self, ) -> *const RedisModuleString
Auto Trait Implementations§
impl Freeze for Defrag
impl RefUnwindSafe for Defrag
impl !Send for Defrag
impl !Sync for Defrag
impl Unpin for Defrag
impl UnwindSafe for Defrag
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