{"id":57959,"library":"ouroboros","title":"Ouroboros","description":"Easy, safe self-referential struct generation.","status":"active","version":"0.18.5","language":"rust","source_language":null,"source_url":"https://github.com/someguynamedjosh/ouroboros","tags":["self-referential","macro","struct","borrow"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nouroboros = \"0.18.5\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add ouroboros","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"self_referencing","correct":"use ouroboros::self_referencing;"}],"quickstart":{"code":"use ouroboros::self_referencing;\n\n#[self_referencing]\nstruct MyStruct {\n    data: String,\n    #[borrows(data)]\n    view: &'this str,\n}\n\nfn main() {\n    let s = MyStructBuilder {\n        data: \"hello\".to_string(),\n        view_builder: |data: &str| &data[..2],\n    }.build();\n    println!(\"{}\", s.borrow_view());\n}","lang":"rust","description":"Creates a self-referential struct with a borrowed view."},"warnings":[{"fix":"Use sparingly or consider alternatives like `ouroboros`.","message":"Macro-heavy; compile times may increase.","severity":"gotcha","affected_versions":">=0.18.0"}],"env_vars":null,"search_vec":"'borrow':14 'easi':2 'generat':8 'macro':12 'ouroboro':1 'referenti':6,11 'safe':3 'self':5,10 'self-referenti':4,9 'struct':7,13","created_at":"2026-06-16T16:06:05.908644+00:00","updated_at":"2026-06-16T16:06:05.908644+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/someguynamedjosh/ouroboros","github":"https://github.com/someguynamedjosh/ouroboros","docs":"https://docs.rs/ouroboros/","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}}