[−][src]Struct iredismodule::io::Digest
Wrap the pointer of a RedisModuleDigest
Implementations
impl Digest
[src]
pub fn add_string<T: AsRef<str>>(&mut self, s: T)
[src]
Add a new element to the digest. This function can be called multiple times
one element after the other, for all the elements that constitute a given
data structure. The function call must be followed by the call to
RedisModule_DigestEndSequence
eventually, when all the elements that are
always in a given order are added. See the Redis Modules data types
documentation for more info. However this is a quick example that uses Redis
data types as an example.
To add a sequence of unordered elements (for example in the case of a Redis Set), the pattern to use is:
foreach element { AddElement(element); EndSequence(); }
Because Sets are not ordered, so every element added has a position that does not depend from the other. However if instead our elements are ordered in pairs, like field-value pairs of an Hash, then one should use:
foreach key,value { AddElement(key); AddElement(value); EndSquence(); }
Because the key and value will be always in the above order, while instead the single key-value pairs, can appear in any position into a Redis hash.
A list of ordered elements would be implemented with:
foreach element { AddElement(element); } EndSequence();
pub fn add_integer(&mut self, i: i64)
[src]
Like Digest::digest_add_string_buffer
but takes a long long as input
that gets converted into a string before adding it to the digest.
pub fn end_sequeue(&mut self)
[src]
See Context:add_string_buffer
Trait Implementations
impl FromPtr for Digest
[src]
type PtrType = RedisModuleDigest
fn from_ptr(ptr: *mut RedisModuleDigest) -> Digest
[src]
impl GetPtr for Digest
[src]
Auto Trait Implementations
impl RefUnwindSafe for Digest
impl !Send for Digest
impl !Sync for Digest
impl Unpin for Digest
impl UnwindSafe for Digest
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,