{"id":13672023,"url":"https://github.com/Aeledfyr/deepsize","last_synced_at":"2025-04-27T18:32:02.078Z","repository":{"id":34047626,"uuid":"167108570","full_name":"Aeledfyr/deepsize","owner":"Aeledfyr","description":"A rust crate to find the total size of an object, on the stack and on the heap","archived":false,"fork":false,"pushed_at":"2024-01-12T10:50:25.000Z","size":56,"stargazers_count":106,"open_issues_count":25,"forks_count":26,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T11:15:50.108Z","etag":null,"topics":["rust"],"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/Aeledfyr.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-23T03:12:37.000Z","updated_at":"2025-02-27T20:50:43.000Z","dependencies_parsed_at":"2024-06-19T06:18:22.833Z","dependency_job_id":"f6b7685e-50ce-44db-ab3d-b14d0204a6fa","html_url":"https://github.com/Aeledfyr/deepsize","commit_stats":{"total_commits":33,"total_committers":5,"mean_commits":6.6,"dds":"0.18181818181818177","last_synced_commit":"5deebe687695610e6038dc70753defbe7634d549"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aeledfyr%2Fdeepsize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aeledfyr%2Fdeepsize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aeledfyr%2Fdeepsize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aeledfyr%2Fdeepsize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aeledfyr","download_url":"https://codeload.github.com/Aeledfyr/deepsize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251187394,"owners_count":21549633,"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":["rust"],"created_at":"2024-08-02T09:01:24.517Z","updated_at":"2025-04-27T18:32:01.432Z","avatar_url":"https://github.com/Aeledfyr.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\n# deepsize\n![](https://img.shields.io/crates/v/deepsize.svg) [![](https://img.shields.io/badge/docs-deepsize-blue.svg)](https://docs.rs/deepsize)\n\nA trait and derive macro to recursively find the size of an object\nand the size of allocations that it owns.\n\nThis should work in `#[no_std]` environments, but requires the `alloc` crate.\n\n## Ownership and Reference Counting\n\n`DeepSizeOf` counts all memory considered \"owned\" by the structure\nthat it is finding the size of.  Structures behind `\u0026` and `\u0026mut`\nreferences are not counted towards the total size of the structure;\nhowever, uniquely owned structures such as `Box` and `Vec` are.\n\nReference counted pointers (`Arc`, and `Rc`) are counted the first\ntime that they appear, and are tracked to prevent them from being\ncounted multiple times.  The `Weak` variants of each are treated like\nreferences, and are not counted.\n\n## Features\n\n* `std` (enabled by default): Adds implementations of `DeepSizeOf`\n  for types only found in `std` such as `HashMap` and `Mutex`.\n* `derive` (enabled by default): Adds support for a derive macro for\n  `DeepSizeOf`.\n\n`deepsize` also has optional support for these external crates:\n\n* `slotmap`: (version 0.4)\n* `slab`: (version 0.4)\n* `indexmap`: (version 1)\n* `arrayvec`: (version 0.5)\n* `smallvec`: (version 1)\n* `hashbrown`: (version 0.9)\n* `chrono`: (version 0.4)\n* `actix`: (version 0.11)\n* `tokio`: (version 1.1)\n\n## Example Code\n\n```rust\nuse std::mem::size_of;\n\nuse deepsize::DeepSizeOf;\n\n#[derive(DeepSizeOf)]\nstruct Test {\n    a: u32,\n    b: Box\u003c[u8]\u003e,\n}\n\nfn main() {\n    let object = Test {\n        a: 15,\n        b: Box::new(*b\"Hello, Wold!\"),\n    };\n\n    assert_eq!(object.deep_size_of(), size_of::\u003cTest\u003e() + size_of::\u003cu8\u003e() * 12);\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAeledfyr%2Fdeepsize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAeledfyr%2Fdeepsize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAeledfyr%2Fdeepsize/lists"}