{"id":57592,"library":"zerocopy","title":"Zerocopy","description":"Zerocopy makes zero-cost memory manipulation effortless by providing safe abstractions over unsafe code.","status":"active","version":"0.8.52","language":"rust","source_language":null,"source_url":"https://github.com/google/zerocopy","tags":["zero-copy","serialization","unsafe","memory","no-std"],"install":[{"cmd":"# Cargo.toml\n[dependencies]\nzerocopy = \"0.8.52\"","lang":"toml","label":"Cargo.toml"},{"cmd":"cargo add zerocopy","lang":"bash","label":"cargo add"}],"dependencies":[],"imports":[{"symbol":"FromBytes","correct":"use zerocopy::FromBytes;"}],"quickstart":{"code":"use zerocopy::FromBytes;\n\n#[derive(FromBytes)]\n#[repr(C)]\nstruct MyStruct {\n    x: u32,\n    y: u16,\n}\n\nfn main() {\n    let bytes = [0u8; 6];\n    let my_struct = MyStruct::read_from(&bytes[..]).unwrap();\n    println!(\"x: {}, y: {}\", my_struct.x, my_struct.y);\n}","lang":"rust","description":"Derive FromBytes to safely interpret byte slices as a struct."},"warnings":[{"fix":"Add `features = [\"derive\"]` to the zerocopy dependency in Cargo.toml.","message":"Requires the `derive` feature for derive macros.","severity":"gotcha","affected_versions":">=0.6.0"}],"env_vars":null,"search_vec":"'abstract':13 'code':16 'copi':19 'cost':6 'effortless':9 'make':3 'manipul':8 'memori':7,22 'no-std':23 'provid':11 'safe':12 'serial':20 'std':25 'unsaf':15,21 'zero':5,18 'zero-copi':17 'zero-cost':4 'zerocopi':1,2","created_at":"2026-06-16T15:50:04.326278+00:00","updated_at":"2026-06-16T15:50:04.326278+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/google/zerocopy","github":"https://github.com/google/zerocopy","docs":"https://docs.rs/zerocopy/","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization","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}}