#[non_exhaustive]pub struct FieldDescriptor {
pub name: &'static str,
pub label: &'static str,
pub format: FieldFormat,
}Expand description
Descriptor for one field of a typed document. Carries enough metadata
for a renderer to display the field with its proper label, in proper
order, with a format hint dispatched off FieldFormat.
#[non_exhaustive] so additional fields (e.g. nullability hints,
deprecation markers) can land additively without breaking external
consumers that struct-literal-construct.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: &'static strThe proto3 field name (snake_case) — matches the JSON key used when the message round-trips through serde.
label: &'static strHuman-readable display label — typically TitleCase or space-separated for multi-word names.
format: FieldFormatRendering hint.
Implementations§
Source§impl FieldDescriptor
impl FieldDescriptor
Sourcepub fn new(name: &'static str, label: &'static str, format: FieldFormat) -> Self
pub fn new(name: &'static str, label: &'static str, format: FieldFormat) -> Self
Construct a FieldDescriptor. Use this from external crates that
register their own types — direct struct-literal construction is
reserved for peat-schema itself so future field additions stay
non-breaking.
Trait Implementations§
Source§impl Clone for FieldDescriptor
impl Clone for FieldDescriptor
Source§fn clone(&self) -> FieldDescriptor
fn clone(&self) -> FieldDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more