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

add Clone to SharedPointerKind's constraints #26

Open
phrohdoh opened this issue May 31, 2023 · 0 comments
Open

add Clone to SharedPointerKind's constraints #26

phrohdoh opened this issue May 31, 2023 · 0 comments

Comments

@phrohdoh
Copy link

I don't yet know enough to be able to determine whether this would break invariants that must be upheld.

Would it be possible & feasible to do this so that RcK & ArcK impl Clone?

I have a type (Value) and would like to derive/impl Clone for it:

pub enum Value<P: archery::SharedPointerKind> {
    Map(Map<P>),
}


#[derive(Debug, Clone)]
pub struct Map<P: SharedPointerKind>(pub(crate) RawMap<P>);

pub type RawMap<P> = rpds::HashTrieMap<Value<P>, Value<P>, P>;

To do so and actually make use of it like so, I have to add + Clone to all of my P: archery::SharedPointerKinds which results in an error because RcK & ArcK are not Clone.

Thank you for the excellent library!

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

No branches or pull requests

1 participant