pub struct BitmapManager { /* private fields */ }Implementations§
Source§impl BitmapManager
impl BitmapManager
Sourcepub async fn bitcount(
&self,
key: &str,
start: Option<usize>,
end: Option<usize>,
) -> Result<usize>
pub async fn bitcount( &self, key: &str, start: Option<usize>, end: Option<usize>, ) -> Result<usize>
Sourcepub async fn bitpos(
&self,
key: &str,
value: u8,
start: Option<usize>,
end: Option<usize>,
) -> Result<Option<usize>>
pub async fn bitpos( &self, key: &str, value: u8, start: Option<usize>, end: Option<usize>, ) -> Result<Option<usize>>
Sourcepub async fn bitop<S>(
&self,
operation: BitmapOperation,
destination: &str,
source_keys: &[S],
) -> Result<usize>
pub async fn bitop<S>( &self, operation: BitmapOperation, destination: &str, source_keys: &[S], ) -> Result<usize>
Perform bitwise operation on multiple bitmaps (BITOP)
§Arguments
operation- Bitwise operation (AND, OR, XOR, NOT)destination- Destination key for resultsource_keys- Source bitmap keys (NOT requires exactly 1 source)
§Returns
Length of resulting bitmap in bits
§Errors
Returns an error if:
- NOT operation is used with more than one source key
- No source keys provided
Sourcepub async fn bitfield(
&self,
key: &str,
operations: &[Value],
) -> Result<Vec<i64>>
pub async fn bitfield( &self, key: &str, operations: &[Value], ) -> Result<Vec<i64>>
Execute bitfield operations (BITFIELD)
§Arguments
key- Bitmap keyoperations- Vector of bitfield operations
§Returns
Vector of result values (one per operation)
§Example
use synap_sdk::bitmap::BitmapManager;
use serde_json::json;
let operations = vec![
json!({
"operation": "SET",
"offset": 0,
"width": 8,
"signed": false,
"value": 42
}),
json!({
"operation": "GET",
"offset": 0,
"width": 8,
"signed": false
}),
json!({
"operation": "INCRBY",
"offset": 0,
"width": 8,
"signed": false,
"increment": 10,
"overflow": "WRAP"
}),
];
let results = bitmap.bitfield("mybitmap", &operations).await?;Sourcepub async fn stats(&self) -> Result<BitmapStats>
pub async fn stats(&self) -> Result<BitmapStats>
Retrieve bitmap statistics
Trait Implementations§
Source§impl Clone for BitmapManager
impl Clone for BitmapManager
Source§fn clone(&self) -> BitmapManager
fn clone(&self) -> BitmapManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BitmapManager
impl !RefUnwindSafe for BitmapManager
impl Send for BitmapManager
impl Sync for BitmapManager
impl Unpin for BitmapManager
impl UnsafeUnpin for BitmapManager
impl !UnwindSafe for BitmapManager
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