pub struct StructScalar<'a> { /* private fields */ }Expand description
A scalar value representing a struct with named fields.
This type provides a view into a struct scalar value, which can contain named fields with different types, or be null.
Implementations§
Source§impl<'a> StructScalar<'a>
impl<'a> StructScalar<'a>
Sourcepub fn struct_fields(&self) -> &StructFields
pub fn struct_fields(&self) -> &StructFields
Returns the struct field definitions.
Sourcepub fn names(&self) -> &FieldNames
pub fn names(&self) -> &FieldNames
Returns the field names of the struct.
Sourcepub fn field(&self, name: impl AsRef<str>) -> Option<Scalar>
pub fn field(&self, name: impl AsRef<str>) -> Option<Scalar>
Returns the field with the given name as a scalar.
Returns None if the field doesn’t exist.
Sourcepub fn field_by_idx(&self, idx: usize) -> Option<Scalar>
pub fn field_by_idx(&self, idx: usize) -> Option<Scalar>
Returns the field at the given index as a scalar.
Returns None if the index is out of bounds.
§Panics
Panics if the struct is null.
Sourcepub fn fields(&self) -> Option<Vec<Scalar>>
pub fn fields(&self) -> Option<Vec<Scalar>>
Returns the fields of the struct scalar, or None if the scalar is null.
Trait Implementations§
Source§impl Display for StructScalar<'_>
impl Display for StructScalar<'_>
Source§impl Hash for StructScalar<'_>
impl Hash for StructScalar<'_>
Source§impl PartialEq for StructScalar<'_>
impl PartialEq for StructScalar<'_>
Source§impl PartialOrd for StructScalar<'_>
Ord is not implemented since it’s undefined for different field DTypes
impl PartialOrd for StructScalar<'_>
Ord is not implemented since it’s undefined for different field DTypes
Source§impl<'a> TryFrom<&'a Scalar> for StructScalar<'a>
impl<'a> TryFrom<&'a Scalar> for StructScalar<'a>
impl Eq for StructScalar<'_>
Auto Trait Implementations§
impl<'a> Freeze for StructScalar<'a>
impl<'a> RefUnwindSafe for StructScalar<'a>
impl<'a> Send for StructScalar<'a>
impl<'a> Sync for StructScalar<'a>
impl<'a> Unpin for StructScalar<'a>
impl<'a> UnwindSafe for StructScalar<'a>
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<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<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