mirror of
https://github.com/darkicewolf50/RustBrock.git
synced 2025-07-07 19:47:15 -06:00
finsihed ch14.1 and more than halfway through ch14.2
This commit is contained in:
68
For later baja.md
Normal file
68
For later baja.md
Normal file
@ -0,0 +1,68 @@
|
||||
Not happy with this
|
||||
|
||||
Rust is a very unique language and a great guiding book.
|
||||
You can learn more [here](https://doc.rust-lang.org/book/ch14-02-publishing-to-crates-io.html) about Rust's Documentation for publishing packages.
|
||||
|
||||
The goal of this is to passively train you how to produce comments and code worthy of being open source and industry level.
|
||||
|
||||
Due to the language's interesting module seperating when creating a large program. All members will be involved in the creation of all functions and how they should be seperated.
|
||||
|
||||
First off the file tree structure will look like this example
|
||||
```
|
||||
src/
|
||||
├── lib.rs
|
||||
├── front_of_house.rs
|
||||
└── front_of_house/
|
||||
├── a_different_mod.rs
|
||||
└── other_module_linked_in_modrs.rs
|
||||
```
|
||||
These are all related functions in front of house, for small modules do not make a sub directory only large or major functions should be seperated
|
||||
|
||||
Where *`front_of_house.rs`* is like this
|
||||
```rust
|
||||
//! Describes what front_of_house module provides
|
||||
//! All functionality in other files this serves as a connector
|
||||
//! Main functionality or run should be a sub file named appropriatly
|
||||
//! re exports go here as well
|
||||
pub mod a_different_mod;
|
||||
pub mod other_module_linked_in_modrs;
|
||||
```
|
||||
|
||||
Also where *`other_module_linked_in_modrs.rs`* looks like this
|
||||
```rust
|
||||
/// What the function does
|
||||
///
|
||||
/// ### Params
|
||||
///
|
||||
/// - input_var - Description of what the input should be.
|
||||
/// - b - Description of the second input parameter.
|
||||
///
|
||||
/// ### Returns
|
||||
///
|
||||
/// - Description of the return value.
|
||||
///
|
||||
/// ### Example Usage
|
||||
///
|
||||
/// ```rust
|
||||
/// // how a user would use this function, replace ex_crate with actual path to use function
|
||||
/// // this is how a public but internal module would be used by an outside user (ex_crate needs to be changed)
|
||||
/// let result = crate::front_of_house::other_module_linked_in_modrs::example_funct(5, 10);
|
||||
/// assert_eq!(result, 15);
|
||||
/// ```
|
||||
/// ### Author (s)
|
||||
///
|
||||
/// - Name <semiperminant@exmaplemail.com>
|
||||
/// - Another Example <different@examplemail.com>
|
||||
/// semi-permanent email, do not need to respond but try to be a good alumni
|
||||
pub fn example_funct(input_var: i32, b: i32) -> i32 {
|
||||
// example variable can be anything not just an integer
|
||||
let var_example = 0;
|
||||
|
||||
// example function does nothing significant
|
||||
var_example + input_var + b
|
||||
}
|
||||
```
|
||||
|
||||
One all of the main modules have been decided upon a senior member or lead will be assigned to that module will then be responsible and will break the module into sub modules with their team
|
||||
|
||||
The team will then come other for a final time to ensure that all modules and sub modules make sense and thier ideas make sense
|
Reference in New Issue
Block a user