{"id":22297475,"url":"https://github.com/rustonaut/vec1","last_synced_at":"2025-04-04T12:08:37.367Z","repository":{"id":45083641,"uuid":"117703394","full_name":"rustonaut/vec1","owner":"rustonaut","description":"Rust `Vec\u003cT\u003e` wrapper that gurantees to contain at least 1 element","archived":false,"fork":false,"pushed_at":"2024-05-25T18:01:08.000Z","size":216,"stargazers_count":90,"open_issues_count":4,"forks_count":15,"subscribers_count":5,"default_branch":"nightly","last_synced_at":"2024-10-31T21:02:30.343Z","etag":null,"topics":["collections","data-structures","vec"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustonaut.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2018-01-16T15:41:24.000Z","updated_at":"2024-10-19T21:24:04.000Z","dependencies_parsed_at":"2024-06-19T00:22:36.258Z","dependency_job_id":null,"html_url":"https://github.com/rustonaut/vec1","commit_stats":{"total_commits":96,"total_committers":13,"mean_commits":7.384615384615385,"dds":0.5104166666666667,"last_synced_commit":"454b3643c816c5359fc3683c862d024ecdb51133"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fvec1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fvec1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fvec1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustonaut%2Fvec1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustonaut","download_url":"https://codeload.github.com/rustonaut/vec1/tar.gz/refs/heads/nightly","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174423,"owners_count":20896078,"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":["collections","data-structures","vec"],"created_at":"2024-12-03T17:49:52.855Z","updated_at":"2025-04-04T12:08:37.346Z","avatar_url":"https://github.com/rustonaut.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"vec1 [![Crates.io](https://img.shields.io/crates/v/vec1.svg)](https://crates.io/crates/vec1) [![vec1](https://docs.rs/vec1/badge.svg)](https://docs.rs/vec1) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n=============\n\nThis crate provides a rust `std::vec::Vec` wrapper with type\nguarantees to contain at least 1 element. This is useful if\nyou build a API which sometimes has such constraints e.g. you\nneed at least one target server address but there can be more.\n\nExample\n--------\n\n```rust\n#[macro_use]\nextern crate vec1;\n\nuse vec1::Vec1;\n\nfn main() {\n    // vec1![] makes sure there is at least one element\n    // at compiler time\n    //let names = vec1! [ ];\n    let names = vec1! [ \"Liz\" ];\n    greet(names);\n}\n\nfn greet(names: Vec1\u003c\u0026str\u003e) {\n    // methods like first/last which return a Option on Vec do\n    // directly return the value, we know it's possible\n    let first = names.first();\n    println!(\"hallo {}\", first);\n    for name in names.iter().skip(1) {\n        println!(\"  who is also know as {}\", name)\n    }\n}\n\n```\n\nSupport for `serde::{Serialize, Deserialize}`\n-------------\n\nThe `Vec1` type supports both of [`serde`](https://serde.rs/)'s `Serialize` and\n`Deserialize` traits, but this feature is only enabled when the `\"serde\"` feature\nflag is specified in your project's `Cargo.toml` file:\n\n```toml\n# Cargo.toml\n\n[dependencies]\nvec1 = { version = \"...\", features = [\"serde\"] }\n```\n\nBuilding docs like on docs.rs\n-------------\n\nTo build docs which document all features and contains hints\nwhich functions require which features use following command:\n\n```sh\nRUSTDOCFLAGS=\"--cfg docs\" cargo +nightly doc --all-features\n```\n\nThis will document all features and enable the unstable\nnightly only `doc_auto_cfg` feature.\n\n\nLicense\n--------\n\nLicensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\nContribution\n------------\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall\nbe dual licensed as above, without any additional terms or conditions.\n\nContributors: [./CONTRIBUTORS.md](./CONTRIBUTORS.md)\n\nChange Log\n-----------\n\nSee [./CHANGELOG.md](./CHANGELOG.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustonaut%2Fvec1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustonaut%2Fvec1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustonaut%2Fvec1/lists"}