{"id":59064,"library":"self-cell","title":"Self Cell","description":"Safe-to-use proc-macro-free self-referential structs in stable Rust.","status":"active","version":"1.2.2","language":"rust","source_language":null,"source_url":"https://github.com/Voultapher/self_cell","tags":["self-referential","no-proc-macro","safe","struct"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nself_cell = \"1.2.2\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add self_cell","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"self_cell","correct":"use self_cell::self_cell;"}],"quickstart":{"code":"use self_cell::self_cell;\n\nself_cell!(\n    struct MyCell {\n        owner: String,\n        #[not_covariant]\n        dependent: &str,\n    }\n);\n\nfn main() {\n    let cell = MyCell::new(\"hello\".to_string(), |s| &s[..]);\n    println!(\"{}\", cell.borrow_dependent());\n}","lang":"rust","description":"Create a self-referential struct using the self_cell macro."},"warnings":[{"fix":"Add #[not_covariant] attribute to the dependent field.","message":"The dependent field must be marked with #[not_covariant] to avoid unsoundness.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'cell':2 'free':10 'macro':9,24 'no-proc-macro':21 'proc':8,23 'proc-macro-fre':7 'referenti':13,20 'rust':17 'safe':4,25 'safe-to-us':3 'self':1,12,19 'self-referenti':11,18 'stabl':16 'struct':14,26 'use':6","created_at":"2026-06-16T16:49:01.292007+00:00","updated_at":"2026-06-16T16:49:01.292007+00:00","problems":[],"ecosystem":"crates","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/Voultapher/self_cell","github":"https://github.com/Voultapher/self_cell","docs":"https://docs.rs/self_cell/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-16","next_check":"2026-12-13","install_tag":null}}