pub struct TypeSchemaBuilder { /* private fields */ }Expand description
Builder for creating type schemas fluently
Implementations§
Source§impl TypeSchemaBuilder
impl TypeSchemaBuilder
Sourcepub fn decimal_field(self, name: impl Into<String>) -> Self
pub fn decimal_field(self, name: impl Into<String>) -> Self
Add a decimal field (stored as f64, reconstructed as Decimal on read)
Sourcepub fn bool_field(self, name: impl Into<String>) -> Self
pub fn bool_field(self, name: impl Into<String>) -> Self
Add a boolean field
Sourcepub fn string_field(self, name: impl Into<String>) -> Self
pub fn string_field(self, name: impl Into<String>) -> Self
Add a string field
Sourcepub fn timestamp_field(self, name: impl Into<String>) -> Self
pub fn timestamp_field(self, name: impl Into<String>) -> Self
Add a timestamp field
Sourcepub fn object_field(
self,
name: impl Into<String>,
type_name: impl Into<String>,
) -> Self
pub fn object_field( self, name: impl Into<String>, type_name: impl Into<String>, ) -> Self
Add a nested object field
Sourcepub fn array_field(
self,
name: impl Into<String>,
element_type: FieldType,
) -> Self
pub fn array_field( self, name: impl Into<String>, element_type: FieldType, ) -> Self
Add an array field
Sourcepub fn field_with_meta(
self,
name: impl Into<String>,
field_type: FieldType,
annotations: Vec<FieldAnnotation>,
) -> Self
pub fn field_with_meta( self, name: impl Into<String>, field_type: FieldType, annotations: Vec<FieldAnnotation>, ) -> Self
Add a field with annotation metadata
Sourcepub fn build(self) -> TypeSchema
pub fn build(self) -> TypeSchema
Build the type schema
Sourcepub fn register(self, registry: &mut TypeSchemaRegistry) -> SchemaId
pub fn register(self, registry: &mut TypeSchemaRegistry) -> SchemaId
Build and register in a registry
Auto Trait Implementations§
impl Freeze for TypeSchemaBuilder
impl RefUnwindSafe for TypeSchemaBuilder
impl Send for TypeSchemaBuilder
impl Sync for TypeSchemaBuilder
impl Unpin for TypeSchemaBuilder
impl UnsafeUnpin for TypeSchemaBuilder
impl UnwindSafe for TypeSchemaBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more