pub struct SchemaField {
pub typ: ActiveType,
pub min: Option<NodeId>,
pub max: Option<NodeId>,
pub min_len: Option<NodeId>,
pub max_len: Option<NodeId>,
pub pattern: Option<NodeId>,
pub default: Option<NodeId>,
pub deprecated: Option<String>,
pub span: Option<Span>,
}Expand description
One field’s schema: a type plus its constraint arguments (spec §2.10,
C-030). Constraint values are expression nodes so bounds may use
literals, env refs, and arithmetic; C-031 evaluates them during
validation. default is parsed and stored; C-032 applies it.
deprecated is static text (C-042): None is live, Some("") is
a bare deprecated = true, Some(msg) carries the migration
message.
Fields§
§typ: ActiveType§min: Option<NodeId>§max: Option<NodeId>§min_len: Option<NodeId>§max_len: Option<NodeId>§pattern: Option<NodeId>§default: Option<NodeId>§deprecated: Option<String>§span: Option<Span>Implementations§
Source§impl SchemaField
impl SchemaField
Sourcepub fn bare(typ: ActiveType, span: Option<Span>) -> Self
pub fn bare(typ: ActiveType, span: Option<Span>) -> Self
A field with no constraint arguments.
Trait Implementations§
Source§impl Clone for SchemaField
impl Clone for SchemaField
Auto Trait Implementations§
impl Freeze for SchemaField
impl RefUnwindSafe for SchemaField
impl Send for SchemaField
impl Sync for SchemaField
impl Unpin for SchemaField
impl UnsafeUnpin for SchemaField
impl UnwindSafe for SchemaField
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more