{"id":22369268,"url":"https://github.com/tushcmd/rust-base","last_synced_at":"2025-03-26T16:20:34.392Z","repository":{"id":246433932,"uuid":"821037406","full_name":"tushcmd/rust-base","owner":"tushcmd","description":"Rust Programming base code layout ","archived":false,"fork":false,"pushed_at":"2024-07-01T21:30:35.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T19:14:10.854Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tushcmd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-27T17:21:56.000Z","updated_at":"2024-07-01T21:30:39.000Z","dependencies_parsed_at":"2024-06-28T00:02:06.042Z","dependency_job_id":"17a3b746-de2f-42a3-859a-58e3baaa6929","html_url":"https://github.com/tushcmd/rust-base","commit_stats":null,"previous_names":["tushcmd/rust-base"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushcmd%2Frust-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushcmd%2Frust-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushcmd%2Frust-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushcmd%2Frust-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tushcmd","download_url":"https://codeload.github.com/tushcmd/rust-base/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245689474,"owners_count":20656418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T19:19:36.488Z","updated_at":"2025-03-26T16:20:34.368Z","avatar_url":"https://github.com/tushcmd.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust-base code layout\n\nThis is an opinionated way to start a rust project\n\n## Initialise the project\n\nInitialise a rust project in the current folder\n\n```sh\ncargo init\n```\n\nThis is how `cargo.toml` looks like initially.\n`cargo.toml` - This is called a manifest, and it contains all of the metadata that Cargo needs to compile your package.\n\n```toml\n[package]\nname = \"rust-base\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[dependencies]\n```\n\n### Dependencies\n\nDependencies to add\nFirst we add thiserror for error handling under dependencies\n\n```toml\nthiserror = \"1\"\n```\n\nIf you intend to use async add tokio\n\n```toml\ntokio = { version = \"1\", features = [\"full\"] }\n```\n\nIf you are doing a command line interface you may use\n\n```toml\nclap = { version = \"4\", features = [\"cargo\"] }\n```\n\n### Dev dependencies\n\nAdd dev dependencies\nanyhow - good for unit tests, examples and benchmarks\n\n```toml\n[dev-dependencies]\nanyhow = \"1\"\n```\n\n### Full `cargo.toml` file\n\n```toml\n[package]\nname = \"rust-base\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[dependencies]\ntokio = { version = \"1\", features = [\"full\"] }\n\n[dev-dependencies]\nanyhow = \"1\"\n```\n\nNow run\n\n```sh\ncargo build\n```\n\nThen\n\n```sh\ncargo run\n```\n\nOr\n\n```sh\n./target/debug/rust-base\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftushcmd%2Frust-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftushcmd%2Frust-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftushcmd%2Frust-base/lists"}