pub struct ScalarAndMetadata {
pub value: ScalarValue,
pub metadata: Option<FieldMetadata>,
}Expand description
A ScalarValue with optional FieldMetadata
Fields§
§value: ScalarValue§metadata: Option<FieldMetadata>Implementations§
Source§impl ScalarAndMetadata
impl ScalarAndMetadata
Sourcepub fn new(value: ScalarValue, metadata: Option<FieldMetadata>) -> Self
pub fn new(value: ScalarValue, metadata: Option<FieldMetadata>) -> Self
Create a new Literal from a scalar value with optional FieldMetadata
Sourcepub fn value(&self) -> &ScalarValue
pub fn value(&self) -> &ScalarValue
Access the underlying ScalarValue storage
Sourcepub fn metadata(&self) -> Option<&FieldMetadata>
pub fn metadata(&self) -> Option<&FieldMetadata>
Access the FieldMetadata attached to this value, if any
Sourcepub fn into_inner(self) -> (ScalarValue, Option<FieldMetadata>)
pub fn into_inner(self) -> (ScalarValue, Option<FieldMetadata>)
Consume self and return components
Sourcepub fn cast_storage_to(
&self,
target_type: &DataType,
) -> Result<Self, DataFusionError>
pub fn cast_storage_to( &self, target_type: &DataType, ) -> Result<Self, DataFusionError>
Cast this values’s storage type
This operation assumes that if the underlying ScalarValue can be casted to a given type that any extension type represented by the metadata is also valid.
Trait Implementations§
Source§impl Clone for ScalarAndMetadata
impl Clone for ScalarAndMetadata
Source§fn clone(&self) -> ScalarAndMetadata
fn clone(&self) -> ScalarAndMetadata
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 ScalarAndMetadata
impl Debug for ScalarAndMetadata
Source§impl From<ScalarValue> for ScalarAndMetadata
create a new ScalarAndMetadata from a ScalarValue without
any metadata
impl From<ScalarValue> for ScalarAndMetadata
create a new ScalarAndMetadata from a ScalarValue without any metadata
Source§fn from(value: ScalarValue) -> Self
fn from(value: ScalarValue) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ScalarAndMetadata
impl !RefUnwindSafe for ScalarAndMetadata
impl Send for ScalarAndMetadata
impl Sync for ScalarAndMetadata
impl Unpin for ScalarAndMetadata
impl !UnwindSafe for ScalarAndMetadata
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<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