pub struct StructType { /* private fields */ }
Expand description
DataType for a specific struct
Implementations§
Source§impl StructType
impl StructType
Sourcepub fn new(fields: Vec<StructField>) -> StructType
pub fn new(fields: Vec<StructField>) -> StructType
Creates a new StructType with the given fields
§Arguments
fields
- Vector of StructField that define the structure
The method automatically builds a lookup table mapping field IDs to their position in the fields vector for efficient field access by ID.
Sourcepub fn builder() -> StructTypeBuilder
pub fn builder() -> StructTypeBuilder
Creates a new StructTypeBuilder to construct a StructType using the builder pattern
This is the recommended way to construct complex StructType instances when you need to add fields incrementally or conditionally.
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 Clone for StructType
impl Clone for StructType
Source§fn clone(&self) -> StructType
fn clone(&self) -> StructType
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 StructType
impl Debug for StructType
Source§impl<'de> Deserialize<'de> for StructType
impl<'de> Deserialize<'de> for StructType
Source§fn deserialize<D>(
deserializer: D,
) -> Result<StructType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<StructType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Index<usize> for StructType
impl Index<usize> for StructType
Source§impl PartialEq for StructType
impl PartialEq for StructType
Source§impl Serialize for StructType
impl Serialize for StructType
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
Source§impl TryFrom<&Fields> for StructType
impl TryFrom<&Fields> for StructType
Source§impl TryFrom<&Schema> for StructType
impl TryFrom<&Schema> for StructType
Source§impl TryInto<Fields> for &StructType
impl TryInto<Fields> for &StructType
Source§impl TryInto<Schema> for &StructType
impl TryInto<Schema> for &StructType
impl Eq for StructType
impl StructuralPartialEq for StructType
Auto Trait Implementations§
impl Freeze for StructType
impl RefUnwindSafe for StructType
impl Send for StructType
impl Sync for StructType
impl Unpin for StructType
impl UnwindSafe for StructType
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 more