rust/zerocopy/benches/try_read_from_prefix.rs

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

File Facts

System
Linux kernel
Corpus path
rust/zerocopy/benches/try_read_from_prefix.rs
Extension
.rs
Size
300 bytes
Lines
11
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_static_size.rs"]
mod format;

#[unsafe(no_mangle)]
fn bench_try_read_from_prefix_static_size(source: &[u8]) -> Option<format::CocoPacket> {
    match zerocopy::TryFromBytes::try_read_from_prefix(source) {
        Ok((packet, _rest)) => Some(packet),
        _ => None,
    }
}

Annotation

Implementation Notes