Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ephraimfeldblum
Copy link
Contributor

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.

…r a module that wants to call C fns given Rust structs
@gkorland gkorland requested a review from iddm May 2, 2023 07:31
Copy link
Collaborator

@iddm iddm left a 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,
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants