-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publicizing RedisKey member #245
base: master
Are you sure you want to change the base?
Conversation
…r a module that wants to call C fns given Rust structs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to resolve the conflicts and rebase onto the latest master.
@@ -33,7 +33,7 @@ pub enum KeyMode { | |||
#[derive(Debug)] | |||
pub struct RedisKey { | |||
ctx: *mut raw::RedisModuleCtx, | |||
key_inner: *mut raw::RedisModuleKey, | |||
pub key_inner: *mut raw::RedisModuleKey, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we instead have a method to return it, rather than having it visible to everyone. Usually, such methods are called as_ptr
and as_mut_ptr
. I suggest we follow the conventional naming and leave this struct member private in favour of having a method.
I also didn't see where it was needed exactly and in what way. Perhaps, if there are examples of where it is needed, we could make it accessible in a more optimal way.
Maybe
RedisKey::key_inner
shouldn't be public in the general case, but it is required for a module that wants to call C fns expecting*RedisModuleKey
given Rust structs.