Rust ASCII Art library - the first approach

In order to try the current state of things in Rust, I decided I want to hack a little program in Rust, nothing too complicated. Inspired by a great Haskell tutorial, that doesn't start with a recursive implementation of fibonacci sequence, but with something actually interesting, like drawing images, I thought I could start with something similar. A bit less ambitious though, just drawing ASCII art on the terminal.

Turns out, I underestimated the whole thing a bit. For the first two approaches i basically just hacked away, to find that in the end I programmed myself into a corner and should start over again.

The third iteration now also contains tests, which helped a lot guiding how an API should look like and what I actually want to achieve.

First approach - doesn't even compile properly

My first approach was relatively straight forward, with different types for Circle, Line, Canvas etc. which should be able to be combined and then be outputted on the screen.

In the end I tried to dumb down the program to be able to debug it, because it caused issues with combining shapes - some of the coordinates should actually be drawn as a Line, but showed up empty (as a Canvas), apart from that I also created some weird workarounds to fight Rusts quite aggressvive borrow checker.

As there are no interfaces in Rust, I tried to implement a common trait for all Shapes, the trait is called Plottable. This introduced another set of errors, as it's not possible to just put a trait into a collection in Rust, because a trait doesn't have a size known to the compiler, therefore it doesn't know how much space to allocate e. g. for a Vec<Plottable>. So I needed to Box<Plottable>, which causes API changes and more type warnings all over the place.

In the end, this showed that the design just wasn't mature enough:

So all in all: the first approach failed, back to the drawing board.