---
layout: post
title: Representing Trees in Rust
---

I recently wanted to create an n-tree in Rust for a small project,
and found a few resources. I've put together a small example that
heavily relies on `Box` types.

While an `impl Trait` can potentially work here, they're not
yet supported on trait functions.

[Playground link here.](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=3d70f38d46f67497ee7285435f7fceef)


---
layout: post
title: Representing Trees in Rust
---

I recently wanted to create an n-tree in Rust for a small project,
and found a few resources. I've put together a small example that
heavily relies on `Box` types.

While an `impl Trait` can potentially work here, they're not
yet supported on trait functions.

[Playground link here.](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6caa924ed070517871033c485982e157)

(*02/09/2020 edit:* Updated to use `dyn` traits.)

Update Rust tree example with updated dyn trait fixes.
Update Rust tree example with updated dyn trait fixes.
