{"action":"created","issue":{"url":"https://api.github.com/repos/michaelsproul/rust_radix_trie/issues/16","repository_url":"https://api.github.com/repos/michaelsproul/rust_radix_trie","labels_url":"https://api.github.com/repos/michaelsproul/rust_radix_trie/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/michaelsproul/rust_radix_trie/issues/16/comments","events_url":"https://api.github.com/repos/michaelsproul/rust_radix_trie/issues/16/events","html_url":"https://github.com/michaelsproul/rust_radix_trie/issues/16","id":139811359,"number":16,"title":"Method of visiting all children of a node?","user":{"login":"andrewcsmith","id":378677,"avatar_url":"https://avatars.githubusercontent.com/u/378677?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewcsmith","html_url":"https://github.com/andrewcsmith","followers_url":"https://api.github.com/users/andrewcsmith/followers","following_url":"https://api.github.com/users/andrewcsmith/following{/other_user}","gists_url":"https://api.github.com/users/andrewcsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewcsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewcsmith/subscriptions","organizations_url":"https://api.github.com/users/andrewcsmith/orgs","repos_url":"https://api.github.com/users/andrewcsmith/repos","events_url":"https://api.github.com/users/andrewcsmith/events{/privacy}","received_events_url":"https://api.github.com/users/andrewcsmith/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-03-10T07:36:52Z","updated_at":"2016-03-13T01:27:14Z","closed_at":null,"body":"I'm looking at your traversal traits, and attempting to write a struct that visits all the immediate children of a node and adds their values. However, given that the `children` field is private, I can't figure out how to make my struct traverse the child nodes. Is there something in the current interface that allows this, or would I have to change the actual crate code?\r\n\r\nMy `RefTraversal` code right now (Trie essentially stored as `<&str, u32>`):\r\n\r\n```\r\nstruct GetChildren;\r\nimpl<'a, K: Debug + TrieKey + 'a> RefTraversal<'a, K, u32> for GetChildren {\r\n    type Input = &'a Trie<K, u32>;\r\n    type Output = u32;\r\n\r\n    fn default_result() -> Self::Output { 0u32 }\r\n\r\n    fn child_match_fn(trie: &'a Trie<K, u32>, input: Self::Input, nv: NibbleVec) -> Self::Output {\r\n        // Children code goes here\r\n        Self::run(&input, &input, nv);\r\n        trie.value().unwrap_or(&0u32).clone()\r\n    }\r\n\r\n    fn action_fn(trie: &'a Trie<K, u32>, intermediate: Self::Output, bucket: usize) -> Self::Output {\r\n        intermediate + trie.value().unwrap_or(&0u32)\r\n    }\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/michaelsproul/rust_radix_trie/issues/comments/195847587","html_url":"https://github.com/michaelsproul/rust_radix_trie/issues/16#issuecomment-195847587","issue_url":"https://api.github.com/repos/michaelsproul/rust_radix_trie/issues/16","id":195847587,"user":{"login":"michaelsproul","id":4452260,"avatar_url":"https://avatars.githubusercontent.com/u/4452260?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsproul","html_url":"https://github.com/michaelsproul","followers_url":"https://api.github.com/users/michaelsproul/followers","following_url":"https://api.github.com/users/michaelsproul/following{/other_user}","gists_url":"https://api.github.com/users/michaelsproul/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsproul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsproul/subscriptions","organizations_url":"https://api.github.com/users/michaelsproul/orgs","repos_url":"https://api.github.com/users/michaelsproul/repos","events_url":"https://api.github.com/users/michaelsproul/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsproul/received_events","type":"User","site_admin":false},"created_at":"2016-03-13T01:27:14Z","updated_at":"2016-03-13T01:27:14Z","body":"Ok, I've updated the `master` branch with a working `get_raw_ancestor` function and a public `child_iter` iterator. Let me know if these functions allow you to do what you want to do. There's an example in `examples/child_iter.rs` that you might find useful.\r\n\r\nIt's by no means a perfect fix, so I won't do a release yet, but you can depend upon this version by adding a Git dependency to your Cargo manifest:\r\n\r\n```toml\r\n[dependencies]\r\nradix_trie = { git = \"https://github.com/michaelsproul/rust_radix_trie.git\" }\r\n```"}}