Skip to main content

FieldExt

Trait FieldExt 

Source
pub trait FieldExt {
    // Required method
    fn get(&self, path: &str) -> Option<Meta>;
}
Expand description

Extension methods for a single syn::Field.

Provides dot-path metadata querying across the field’s attributes. The first path segment matches the attribute name, subsequent segments drill into nested metadata.

§Examples

use zyn::ext::FieldExt;

// #[serde(rename = "user_id")]
// pub id: i64,
let meta = field.get("serde.rename"); // → Some(NameValue meta)
let serde = field.get("serde");       // → Some(List meta)

Required Methods§

Source

fn get(&self, path: &str) -> Option<Meta>

Navigates into a field’s attributes using a dot-separated path.

The first segment matches the attribute name, subsequent segments drill into nested metadata using MetaPath syntax.

§Examples
use zyn::ext::FieldExt;

// #[serde(rename = "user_id", skip)]
let rename = field.get("serde.rename"); // → Some(NameValue)
let skip = field.get("serde.skip");     // → Some(Path)

Implementations on Foreign Types§

Source§

impl FieldExt for Field

Source§

fn get(&self, path: &str) -> Option<Meta>

Implementors§