We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 350531c commit df56f94Copy full SHA for df56f94
src/redismodule.rs
@@ -161,6 +161,17 @@ impl RedisString {
161
Self { ctx, inner }
162
}
163
164
+ #[allow(clippy::not_unsafe_ptr_arg_deref)]
165
+ pub fn from_raw_parts(ctx: Option<NonNull<raw::RedisModuleCtx>>, s: *const c_char, len: libc::size_t) -> Self {
166
+ let ctx = ctx.map_or(std::ptr::null_mut(), |v| v.as_ptr());
167
+
168
+ let inner = unsafe {
169
+ raw::RedisModule_CreateString.unwrap()(ctx, s, len)
170
+ };
171
172
+ Self { ctx, inner }
173
+ }
174
175
#[allow(clippy::not_unsafe_ptr_arg_deref)]
176
pub fn create_from_slice(ctx: *mut raw::RedisModuleCtx, s: &[u8]) -> Self {
177
let inner = unsafe {
0 commit comments