Skip to content
Discussion options

You must be logged in to vote

So this does try_iter_pairs() which clones the value (although I think the DynObject is stored in an Arc so that might not have much of a performance cost), but it also calls get_value which I think does this and therefore clones the individual values and then converts them from V into Value:

If the map has a Value as value then clone will only increment the refcount (or something equally cheap). If however the map contains something like a String then it will do something less optimal.

But can I get access to that raw BTreeMap? That way, I could filter on keys more efficiently.

If you know what the value is you can downcast it:

let map = Value::from_object({
    let mut m = BTreeMap::<

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mitsuhiko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants