rust/zerocopy/benches/ref_from_prefix_with_elems_dynamic_size.rs

Source file repositories/reference/linux-study-clean/rust/zerocopy/benches/ref_from_prefix_with_elems_dynamic_size.rs

File Facts

System
Linux kernel
Corpus path
rust/zerocopy/benches/ref_from_prefix_with_elems_dynamic_size.rs
Extension
.rs
Size
344 bytes
Lines
14
Domain
Rust Kernel Layer
Bucket
Rust API Membrane
Inferred role
Rust Kernel Layer: implementation source
Status
source implementation candidate

Why This File Exists

Rust-side wrappers and abstractions around kernel C APIs, ownership contracts, allocation, synchronization, and module integration.

Dependency Surface

Detected Declarations

Annotated Snippet

#[path = "formats/coco_dynamic_size.rs"]
mod format;

#[unsafe(no_mangle)]
fn bench_ref_from_prefix_with_elems_dynamic_size(
    source: &[u8],
    count: usize,
) -> Option<&format::LocoPacket> {
    match zerocopy::FromBytes::ref_from_prefix_with_elems(source, count) {
        Ok((packet, _rest)) => Some(packet),
        _ => None,
    }
}

Annotation

Implementation Notes