{"id":20145888,"url":"https://github.com/usagi/write-to-file","last_synced_at":"2025-06-22T11:37:32.217Z","repository":{"id":143043719,"uuid":"491049643","full_name":"usagi/write-to-file","owner":"usagi","description":null,"archived":false,"fork":false,"pushed_at":"2022-05-11T10:05:35.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T00:14:15.979Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usagi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-05-11T09:49:00.000Z","updated_at":"2023-01-16T13:14:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"dece9e28-bd50-4832-9990-2515e965c5a8","html_url":"https://github.com/usagi/write-to-file","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/usagi/write-to-file","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usagi%2Fwrite-to-file","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usagi%2Fwrite-to-file/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usagi%2Fwrite-to-file/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usagi%2Fwrite-to-file/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usagi","download_url":"https://codeload.github.com/usagi/write-to-file/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usagi%2Fwrite-to-file/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261289028,"owners_count":23136045,"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-13T22:18:36.488Z","updated_at":"2025-06-22T11:37:27.206Z","avatar_url":"https://github.com/usagi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![github]](https://github.com/usagi/write-to-file)\u0026ensp;[![crates-io]](https://crates.io/crates/write-to-file)\u0026ensp;[![docs-rs]](https://docs.rs/write-to-file)\u003cbr\u003e\n[![Build Status](https://travis-ci.org/usagi/write-to-file.svg?branch=master)](https://travis-ci.org/usagi/write-to-file)\n\n[github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge\u0026labelColor=555555\u0026logo=github\n[crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge\u0026labelColor=555555\u0026logo=rust\n[docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge\u0026labelColor=555555\u0026logoColor=white\u0026logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K\n\n# write-to-file\n\nWrite to a file, simple helper fn and traits lib crate.\n\nI'm tired to implements these very simple file writing feature, but I don't need more a rich features. So I publish the crate. Enjoy rust in relaxed. 🤗\n\n## Tests as Examples: [tests/](tests/)\n\n### function version usage:\n\n```rust\nuse write_to_file::write_to_file;\n\n// write binary\nlet buf = vec![1u8, 2, 3, 4];\nlet path = \"target/test/file.bin\";\nwrite_to_file(path, buf).unwrap(); // \u003c- Easy to write!\n\n// write text\nlet buf = \"Nyanko is one of the greatest life.\".to_string();\nlet path = \"target/test/file.txt\";\nwrite_to_file(path, buf).unwrap(); // \u003c- Easy to write!\n```\n\n### trait version usage:\n\n```rust\nuse write_to_file::WriteToFile;\n\n// Vec\u003cu8\u003e\nlet buf: Vec\u003cu8\u003e = vec![1u8, 2, 3, 4];\nlet path = \"target/test/file.bin\";\nbuf.write_to_file(path).unwrap(); // \u003c- Easy to write!\n\n// \u0026[u8]\nlet buf: \u0026[u8] = buf.as_slice();\nlet path = \"target/test/file.bin\";\nbuf.write_to_file(path).unwrap(); // \u003c- Easy to write!\n\n// String\nlet buf: String = \"Nyanko is one of the greatest life.\".to_string();\nlet path = \"target/test/file.txt\";\nbuf.write_to_file(path).unwrap(); // \u003c- Easy to write!\n\n// \u0026str\nlet buf: \u0026str = buf.as_str();\nlet path = \"target/test/file.txt\";\nbuf.write_to_file(path).unwrap(); // \u003c- Easy to write!\n```\n\n## LICENSE\n\n- [MIT](LICENSE.md)\n\n## Author\n\n- USAGI.NETWORK / Usagi Ito \u003chttps://github.com/usagi/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusagi%2Fwrite-to-file","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusagi%2Fwrite-to-file","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusagi%2Fwrite-to-file/lists"}