{"id":21382048,"url":"https://github.com/valshaped/mkfs-btrfs-rs","last_synced_at":"2025-03-16T11:10:44.966Z","repository":{"id":65711392,"uuid":"597564674","full_name":"ValShaped/mkfs-btrfs-rs","owner":"ValShaped","description":"A quick wrapper for mkfs.btrfs in pure safe Rust","archived":false,"fork":false,"pushed_at":"2023-02-06T04:06:44.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T08:28:37.330Z","etag":null,"topics":["btrfs-progs","filesystem","rust","rust-crate"],"latest_commit_sha":null,"homepage":"","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/ValShaped.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-02-04T23:12:56.000Z","updated_at":"2023-02-06T04:00:15.000Z","dependencies_parsed_at":"2023-02-19T04:16:10.563Z","dependency_job_id":null,"html_url":"https://github.com/ValShaped/mkfs-btrfs-rs","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/ValShaped%2Fmkfs-btrfs-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValShaped%2Fmkfs-btrfs-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValShaped%2Fmkfs-btrfs-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ValShaped%2Fmkfs-btrfs-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ValShaped","download_url":"https://codeload.github.com/ValShaped/mkfs-btrfs-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858056,"owners_count":20359271,"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":["btrfs-progs","filesystem","rust","rust-crate"],"created_at":"2024-11-22T10:51:50.524Z","updated_at":"2025-03-16T11:10:44.929Z","avatar_url":"https://github.com/ValShaped.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mkfs-btrfs-rs\n\nA wrapper for `mkfs.btrfs` in type-safe Rust.\n\n\u003e NOT a FFI binding, just command wrapper, to make you feel a bit like you're writing rust.\n\n* If you want to create a btrfs volume, check out the [`Formatter`].\n\n* If you want to see the full list of options, check out [`format::FormatterOptions`].\n\n# Examples\n```rust no_run\nuse mkfs_btrfs_rs::{Result, Formatter};\nfn main() -\u003e Result\u003c()\u003e {\n    let formatter = Formatter::options()\n        .label(\"my_awesome_label\")?\n        .build()\n        .format(\"/tmp/some/file\")?;\n    Ok(())\n}\n```\n```rust no_run\nuse mkfs_btrfs_rs::{Formatter, Result};\nuse std::process::Output;\nfn main() -\u003e Result\u003c()\u003e {\n    let formatter = Formatter::options()\n        // If you provide a rootdir, mkfs.btrfs will copy the stuff in that dir into the new volume\n        .rootdir(\"/\")?\n        // Labels can be arbitrary UTF-8, max 256 bytes\n        .label(\"My Awesome New Partition\")?\n        // Mix data and metadata blocks\n        .mixed()?\n        // Don't force-format\n        // .force()?\n        .build();\n    let Output {\n        status: _status,\n        stdout: out,\n        stderr: err,\n    } = formatter.format(\"/dev/sdxY\")?;\n    println!(\n        \"\u003e STDOUT:\\n{}\\n\u003e STDERR:\\n{}\",\n        String::from_utf8(out).unwrap(),\n        String::from_utf8(err).unwrap(),\n    );\n    Ok(())\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalshaped%2Fmkfs-btrfs-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalshaped%2Fmkfs-btrfs-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalshaped%2Fmkfs-btrfs-rs/lists"}