Module flexible_array

Source
Expand description

A wrapper for structures that contain flexible arrays.

The following code provides generic helpers for creating and accessing flexible array structs. A complete definition of flexible array structs is found in the ISO 9899 specification http://www.iso-9899.info/n1570.html. A flexible array struct is of the form:

#[repr(C)]
struct T {
   some_data: u32,
   nents: u32,
   entries: __IncompleteArrayField<S>,
}

where:

  • T is the flexible array struct type
  • S is the flexible array type
  • nents is the flexible array length
  • entries is the flexible array member

These structures are used by the kernel API.

Structs§

FlexibleArrayWrapper

Traits§

FlexibleArray
A collection of methods that are required by the FlexibleArrayWrapper type.

Functions§

vec_with_array_field
The kernel API has many structs that resemble the following Foo structure:
vec_with_size_in_bytes 🔒