pub struct Schema { /* private fields */ }
Expand description
Names and types of fields in a table.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn builder() -> SchemaBuilder
pub fn builder() -> SchemaBuilder
Creates a new SchemaBuilder to construct a Schema using the builder pattern
§Returns
- A SchemaBuilder instance configured with default values
This is the recommended way to construct Schema instances when you need to add fields incrementally or set optional parameters.
Sourcepub fn from_struct_type(
fields: StructType,
schema_id: i32,
identifier_field_ids: Option<Vec<i32>>,
) -> Schema
pub fn from_struct_type( fields: StructType, schema_id: i32, identifier_field_ids: Option<Vec<i32>>, ) -> Schema
Creates a new Schema from a StructType and associated metadata
§Arguments
fields
- The StructType containing the schema’s fieldsschema_id
- Unique identifier for this schemaidentifier_field_ids
- Optional list of field IDs that identify rows in the table
§Returns
- A new Schema instance with the provided fields and metadata
Methods from Deref<Target = StructType>§
Sourcepub fn get(&self, index: usize) -> Option<&StructField>
pub fn get(&self, index: usize) -> Option<&StructField>
Sourcepub fn get_name(&self, name: &str) -> Option<&StructField>
pub fn get_name(&self, name: &str) -> Option<&StructField>
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of fields in this struct
§Returns
- The total count of StructFields contained in this struct
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the struct contains no fields
§Returns
true
if this struct has no fieldsfalse
if this struct has at least one field
Sourcepub fn iter(&self) -> Iter<'_, StructField>
pub fn iter(&self) -> Iter<'_, StructField>
Returns an iterator over all fields in this struct
§Returns
- An iterator yielding references to each StructField in order
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Schema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Schema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Schema
impl Serialize for Schema
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for Schema
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
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 moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<Q> ToOwnedEquivalent<<Q as ToOwned>::Owned> for Q
impl<Q> ToOwnedEquivalent<<Q as ToOwned>::Owned> for Q
fn to_owned_equivalent(&self) -> <Q as ToOwned>::Owned
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.