Struct redis_module::RedisString
source · [−]pub struct RedisString {
pub inner: *mut RedisModuleString,
/* private fields */
}
Fields
inner: *mut RedisModuleString
Implementations
sourceimpl RedisString
impl RedisString
pub fn new(ctx: *mut RedisModuleCtx, inner: *mut RedisModuleString) -> Self
pub fn create(ctx: *mut RedisModuleCtx, s: &str) -> Self
pub fn from_redis_module_string(
ctx: *mut RedisModuleCtx,
inner: *mut RedisModuleString
) -> Self
pub fn from_ptr<'a>(ptr: *const RedisModuleString) -> Result<&'a str, Utf8Error>
pub fn append(&mut self, s: &str) -> Status
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn try_as_str<'a>(&self) -> Result<&'a str, RedisError>
pub fn as_slice(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
sourcepub fn to_string_lossy(&self) -> String
pub fn to_string_lossy(&self) -> String
Performs lossy conversion of a RedisString
into an owned `String. This conversion
will replace any invalid UTF-8 sequences with U+FFFD REPLACEMENT CHARACTER, which
looks like this: �.
Panics
Will panic if RedisModule_StringPtrLen
is missing in redismodule.h
pub fn parse_unsigned_integer(&self) -> Result<u64, RedisError>
pub fn parse_integer(&self) -> Result<i64, RedisError>
pub fn parse_float(&self) -> Result<f64, RedisError>
Trait Implementations
sourceimpl Borrow<str> for RedisString
impl Borrow<str> for RedisString
sourceimpl Clone for RedisString
impl Clone for RedisString
sourceimpl Debug for RedisString
impl Debug for RedisString
sourceimpl Display for RedisString
impl Display for RedisString
sourceimpl Drop for RedisString
impl Drop for RedisString
sourceimpl From<&'_ RedisString> for RedisValue
impl From<&'_ RedisString> for RedisValue
sourcefn from(s: &RedisString) -> Self
fn from(s: &RedisString) -> Self
Performs the conversion.
sourceimpl From<RedisString> for String
impl From<RedisString> for String
sourcefn from(rs: RedisString) -> Self
fn from(rs: RedisString) -> Self
Performs the conversion.
sourceimpl From<RedisString> for RedisValue
impl From<RedisString> for RedisValue
sourcefn from(s: RedisString) -> Self
fn from(s: RedisString) -> Self
Performs the conversion.
sourceimpl PartialEq<RedisString> for RedisString
impl PartialEq<RedisString> for RedisString
sourcefn eq(&self, other: &RedisString) -> bool
fn eq(&self, other: &RedisString) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &RedisString) -> bool
fn ne(&self, other: &RedisString) -> bool
This method tests for !=
.
impl StructuralPartialEq for RedisString
Auto Trait Implementations
impl RefUnwindSafe for RedisString
impl !Send for RedisString
impl !Sync for RedisString
impl Unpin for RedisString
impl UnwindSafe for RedisString
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more