pub struct ZodContext {
pub schema_name: String,
pub zod_expr: String,
pub is_enum: bool,
pub enum_values: Option<Vec<String>>,
pub description: Option<String>,
pub needs_type_annotation: bool,
pub spec_name: Option<String>,
}Expand description
Context for Zod schema generation.
Fields§
§schema_name: String§zod_expr: String§is_enum: bool§enum_values: Option<Vec<String>>§description: Option<String>§needs_type_annotation: bool§spec_name: Option<String>Spec name (for multi-spec mode)
Implementations§
Source§impl ZodContext
impl ZodContext
Sourcepub fn schema(
schema_name: String,
zod_expr: String,
description: Option<String>,
spec_name: Option<String>,
) -> Self
pub fn schema( schema_name: String, zod_expr: String, description: Option<String>, spec_name: Option<String>, ) -> Self
Create a new ZodContext for a regular schema.
Trait Implementations§
Source§impl Clone for ZodContext
impl Clone for ZodContext
Source§fn clone(&self) -> ZodContext
fn clone(&self) -> ZodContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ZodContext
impl Debug for ZodContext
Auto Trait Implementations§
impl Freeze for ZodContext
impl RefUnwindSafe for ZodContext
impl Send for ZodContext
impl Sync for ZodContext
impl Unpin for ZodContext
impl UnwindSafe for ZodContext
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