{"id":16851881,"url":"https://github.com/cad97/thin-dst","last_synced_at":"2025-03-22T05:31:44.871Z","repository":{"id":57669668,"uuid":"220731563","full_name":"CAD97/thin-dst","owner":"CAD97","description":null,"archived":false,"fork":false,"pushed_at":"2020-03-18T20:55:06.000Z","size":52,"stargazers_count":12,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T08:53:27.761Z","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/CAD97.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}},"created_at":"2019-11-10T02:34:05.000Z","updated_at":"2025-03-04T05:05:22.000Z","dependencies_parsed_at":"2022-09-26T20:40:33.614Z","dependency_job_id":null,"html_url":"https://github.com/CAD97/thin-dst","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CAD97%2Fthin-dst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CAD97%2Fthin-dst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CAD97%2Fthin-dst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CAD97%2Fthin-dst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CAD97","download_url":"https://codeload.github.com/CAD97/thin-dst/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244912800,"owners_count":20530764,"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-10-13T13:33:57.624Z","updated_at":"2025-03-22T05:31:44.532Z","avatar_url":"https://github.com/CAD97.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# thin-dst\n\nBoxed custom DSTs that store a slice and the length of said slice inline.\nUses the standard library collection types for full interoperability,\nand also provides thin owned pointers for space-conscious use.\n\n## Alternative\n\n[slice-dst] is a successor to this crate, which, along with the other\n[pointer-utils] crates, offers a more composable API.\n\nThis crate will continue to be reactively maintained,\nbut any future development will focus on pointer-utils/slice-dst instead.\n\n  [slice-dst]: \u003chttps://lib.rs/crates/slice-dst\u003e\n  [pointer-utils]: \u003chttps://github.com/CAD97/pointer-utils\u003e\n\n## Examples\n\nThe simplest example is just a boxed slice:\n\n```rust\nlet boxed_slice = ThinBox::new((), vec![0, 1, 2, 3, 4, 5]);\nassert_eq!(\u0026*boxed_slice, \u0026[0, 1, 2, 3, 4, 5][..]);\nlet boxed_slice: Box\u003cThinData\u003c(), u32\u003e\u003e = boxed_slice.into();\n```\n\nAll of the thin collection types are constructed with a \"head\" and a \"tail\".\nThe head is any `Sized` type that you would like to associate with the slice.\nThe \"tail\" is the owned slice of data that you would like to store.\n\nThis creates a collection of `ThinData`, which acts like `{ head, tail }`,\nand also handles the `unsafe` required for both custom slice DSTs and thin DST pointers.\nThe most idiomatic usage is to encapsulate the use of thin-dst with a transparent newtype:\n\n```rust\n#[repr(transparent)]\nstruct NodeData(ThinData\u003cNodeHead, Node\u003e);\nstruct Node(ThinArc\u003cNodeHead, Node\u003e);\n```\n\nAnd then use `NodeData` by transmuting and/or [ref-cast]ing as needed.\n\n  [ref-cast]: \u003chttps://lib.rs/crates/ref-cast\u003e\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE/APACHE](LICENSE/APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([LICENSE/MIT](LICENSE/MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\nIf you are a highly paid worker at any company that prioritises profit over\npeople, you can still use this crate. I simply wish you will unionise and push\nback against the obsession for growth, control, and power that is rampant in\nyour workplace. Please take a stand against the horrible working conditions\nthey inflict on your lesser paid colleagues, and more generally their\ndisrespect for the very human rights they claim to fight for.\n\n## Contribution\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 be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcad97%2Fthin-dst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcad97%2Fthin-dst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcad97%2Fthin-dst/lists"}