pub trait StructDataExt {
// Required methods
fn field(&self, name: &str) -> Option<&StructField>;
fn value(&self, index: usize) -> Option<&Scalar>;
fn index_of(&self, name: &str) -> Option<usize>;
}Expand description
Extension trait for Kernel’s StructData.
StructData is the data structure contained in a Struct scalar.
The exposed API on kernels struct data is very minimal and does not allow
for conveniently probing the fields / values contained within StructData.
This trait therefore adds convenience methods for accessing fields and values.
Required Methods§
Sourcefn field(&self, name: &str) -> Option<&StructField>
fn field(&self, name: &str) -> Option<&StructField>
Returns a reference to the field with the given name, if it exists.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".