Skip to content

add Clone to SharedPointerKind's constraints #26

Description

@phrohdoh

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions