{"id":20095073,"url":"https://github.com/dmijatovic/rust-concepts","last_synced_at":"2025-03-02T16:19:09.167Z","repository":{"id":37178705,"uuid":"282305079","full_name":"dmijatovic/rust-concepts","owner":"dmijatovic","description":"Different rust concepts based on some online training","archived":false,"fork":false,"pushed_at":"2023-01-20T22:43:38.000Z","size":775,"stargazers_count":0,"open_issues_count":83,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-13T03:33:14.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dmijatovic.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}},"created_at":"2020-07-24T19:56:54.000Z","updated_at":"2020-09-04T18:53:30.000Z","dependencies_parsed_at":"2023-02-12T06:16:19.481Z","dependency_job_id":null,"html_url":"https://github.com/dmijatovic/rust-concepts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmijatovic%2Frust-concepts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmijatovic%2Frust-concepts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmijatovic%2Frust-concepts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmijatovic%2Frust-concepts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmijatovic","download_url":"https://codeload.github.com/dmijatovic/rust-concepts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241533912,"owners_count":19977877,"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-11-13T16:54:01.131Z","updated_at":"2025-03-02T16:19:09.148Z","avatar_url":"https://github.com/dmijatovic.png","language":"Rust","readme":"# RUST programing language\n\nThis repo contains basics of rust progamming language. I want to get feeling of the language and where it can be applied. Rust seem to be propper language for creating web assembly applications.\n\nMy goal is to lern the basics and see what could be a good use cases for the language in the situations I encounter as programmer.\n\n## Installation\n\nInstallation on unix based system is done running shell script [from the website](https://www.rust-lang.org/learn/get-started)\n\n```bash\n# download and run script\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n\n# select option 1 for default installation\n# restart to load env from .profile file\n```\n\n## Visual Studio Code\n\nYou need to install rust plugin and optionally TOML file support plugin and crates (for package version assistance). In addition, after open first rs file VSC might advice to install additiona rust tooling. I opted yes, the following is installed using rustup toolchain installer\n\n```bash\n#\nrustup component add rust-analyses --toolchain stable-x86_64-unknown-linux-gnu\n#\nrustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu\n```\n\n### Rust-analyzer plugin and debugging\n\nFor debugging in VCS I installed rust-analyzer and [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) plugins.\n\n## Basic commands\n\n```bash\n## rust compiler versopm\nrustc --version\n## cargo version (package manager)\ncargo --version\n## basic build\nrustc build hw.rs\n## production build\nrustc build hw --optimized\n```\n\n## Project skaffold\n\n```bash\n# create new rust project\ncargo init --bin todo-actix\n\n# check for error\ncargo check\n\n# run project in dev\ncargo run\n# run project in release\ncarg run --release\n# build\ncargo build --release\n```\n\n## Dependencies\n\nThe project dependencies are specified in `Cargo.toml` file. You can add dependencies manually. There is a tool [`cargo-edit`](https://github.com/killercup/cargo-edit) you can use to add, remove and update dependencies.\n\n```bash\n# install cargo\ncargo install cargo-edit\n\n# add dependecy to project as build dependencies\ncargo add actix-rt actix-web dotenv --build\n\n# add as dev dependencies\ncargo add regex --dev\n\n```\n\n## Evironment variables\n\nUsing dotenv module we can define envroment variables using .env file in the root of the project. The variables in the .env file use . to split props. See example here for server variables.\n\n```env\nSERVER.HOST=localhost\nSERVER.PORT=8080\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmijatovic%2Frust-concepts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmijatovic%2Frust-concepts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmijatovic%2Frust-concepts/lists"}