{"id":20751024,"url":"https://github.com/vaaaaanquish/hello-rust","last_synced_at":"2026-04-21T15:04:32.457Z","repository":{"id":113485692,"uuid":"247341136","full_name":"vaaaaanquish/hello-rust","owner":"vaaaaanquish","description":"rustを学んだログ","archived":false,"fork":false,"pushed_at":"2020-03-20T15:35:09.000Z","size":362,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-18T03:40:40.418Z","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/vaaaaanquish.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":"2020-03-14T19:34:30.000Z","updated_at":"2020-03-20T15:37:40.000Z","dependencies_parsed_at":"2023-06-28T17:45:19.357Z","dependency_job_id":null,"html_url":"https://github.com/vaaaaanquish/hello-rust","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/vaaaaanquish%2Fhello-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaaaanquish%2Fhello-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaaaanquish%2Fhello-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaaaaanquish%2Fhello-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaaaaanquish","download_url":"https://codeload.github.com/vaaaaanquish/hello-rust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243049683,"owners_count":20227884,"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-17T08:29:43.650Z","updated_at":"2026-04-21T15:04:32.407Z","avatar_url":"https://github.com/vaaaaanquish.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hello-rust\nrustを学んだログ\n\n# install\n\nxonshrc : $PATH.append(expanduser('~/.cargo/bin'))  \ncurl https://sh.rustup.rs -sSf | sh  \nrustup update  \n\n# make project\n\ncargo new sample_cargo  \ncargo build  \ncargo run  \n\n# python連携\n  \nPyO3というのを使うらしい  \nhttps://ohke.hateblo.jp/entry/2020/02/15/230000  \nhttps://qiita.com/osanshouo/items/671888bdd6afeec1e939  \n\nnightlyが必要  \nrustup default nightly  \n  \nbuildしていく  \ncargo +nightly build --release  \n  \nld: symbol(s) not found for architecture x86_64  \nclang: error: linker command failed with exit code 1 (use -v to see invocation)  \n  \nhttps://github.com/PyO3/pyo3/issues/172  \npyo3のREADMEによると.cargo/configに追記が必要らしい  \nhttps://github.com/PyO3/pyo3/blob/master/README.md  \n\nvim ~/.cargo/config  \n``````\n[target.x86_64-apple-darwin]\nrustflags = [\n  \"-C\", \"link-arg=-undefined\",\n  \"-C\", \"link-arg=dynamic_lookup\",\n]\n``````\n\nlibhoge.dylibをhoge.soにする  \n``````\n$ cp target/release/librustpy.dylib target/release/rustpy.so  \n$ cd target/release/\n$ python\n\u003e\u003e\u003e import rustpy\n\u003e\u003e\u003e rustpy.pi_times(10)\n[0.0, 3.141592653589793, 6.283185307179586, 9.42477796076938, 12.566370614359172, 15.707963267948966, 18.84955592153876, 21.991148575128552, 25.132741228718345, 28.27433388\n2308138]\n``````\n\n# pyo3\n\n- https://github.com/PyO3/pyo3/blob/master/README.md  \n``````\nRust\tPython\ni32, usize 等\tint\nf32, f64\tfloat\nbool\tbool\nVec\u003cT\u003e\tlist\nString\tstr\nHashMap\tdict\n``````\n\n# ファイル分割\n\n分割したいよね\n- https://qiita.com/skitaoka/items/753a519d720a1ccebb0d\n\n``````\npub mod bar{\n    pub fn hoge(){}\n}\n``````\nとして別ファイル名foo.rsにした上で\n``````\nmod foo;\nfoo::bar::hoge();\n``````\n\nディレクトリにする時は、__init__.pyみたいにmod.rsを用意する必要があるっぽい\n\n\n# クラス的な何か\n\nstruct, impl, traitをつかう\n- https://qiita.com/nacika_ins/items/cf3782bd371da79def74\n概ね理解\n\n# 全体感\nとりあえず以下一通り\n- https://doc.rust-jp.rs/the-rust-programming-language-ja/1.6/book/learn-rust.html\n    - diner/dinerとguessing-game/guessing_gameがこの文献のサンプル触ったログ\n    \nなんかつくってみる\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaaaaanquish%2Fhello-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaaaaanquish%2Fhello-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaaaaanquish%2Fhello-rust/lists"}