Skip to content

Jolah1/restaurant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍽️ restaurant_jolah β€” A Modular, Reusable Rust Library

This is a simple and educational reusable Rust library.

It demonstrates how to:

  • Organize code with modules and files
  • Control visibility using pub
  • Build reusable components for a real-world-like domain

Why This Is Reusable

  • Clear modular structure: front_of_house vs back_of_house
  • Controlled visibility using pub and private fields
  • Public interface via eat_at_restaurant() or individual module APIs
  • Separate file organization, for scalability.

πŸ“ Project Structure

restaurant/ β”œβ”€β”€ Cargo.toml β”œβ”€β”€ src/ β”‚ β”œβ”€β”€ lib.rs # Library root β”‚ β”œβ”€β”€ front_of_house.rs # Handles customer interactions β”‚ β”œβ”€β”€ back_of_house.rs # Kitchen logic β”‚ └── bin/ β”‚ └── main.rs # Binary example that uses the library


πŸš€ Getting Started

Clone and Run

git clone https://github.com/jolah1/restaurant.git
cd restaurant
cargo run --bin main

Example Usage

use restaurant::eat_at_restaurant;

fn main() {
    eat_at_restaurant();
}

Output

Added to waitlist.
Added to waitlist.
I'd like Wheat toast please

This repo is a practical reference for:

  • Building Rust libraries with clear public APIs

  • Managing code with modular file structure

  • Using privacy rules to protect internal logic

  • Preparing codebases for scalability and reusability

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages