Learning Rust: More Modules! More Tests! More Types!

Rust seems kind of cool

Stewart Charles

Since the last post, there have been several incremental changes made to the game module. First, the module has been expanded to include sub-modules for the network component, and an additional module for testing. These sub-modules have yet to be implemented, but are declared for structural reasons. The tree view of game module is shown below.

Screen Shot 2015-08-03 at 6.35.56 PM

Revenge of the Modules!

As you can see, the complexity of our project is increasing! While it’s tempting to try and cram the entire program into a single main.rs file (actually, it’s not tempting…), we would be better served breaking our project into sub-modules. This is a convenient way of dissembling our project into it’s elementary but related components, which allows us to sensibly navigate our rather complicated hierarchy of related data types, functions and items.

Sub-Modules are ‘linked’ to the parent game module by declaring them from the entry point of the crate…

View original post 979 more words

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s