pub enum Cell {
    Null,
    Int(i128),
    Float(f64),
    Varchar(String),
    Binary(Vec<u8>),
    Boolean(bool),
    Date(NaiveDate),
    Time(NaiveTime),
    TimestampLtz(DateTime<Local>),
    TimestampNtz(NaiveDateTime),
}
Expand description

Cell types, used for receiving data from Snowflake.

Snowflake returns these as a list of Strings; these are the result of parsing those strings, and as such there are some caveats to be aware of.

Variants§

§

Null

A NULL value. Any column could be null unless it is declared as NOT NULL, but the driver is not aware of this information from the metadata.

§

Int(i128)

A 128-bit signed integer, 38 digits of precision. Any NUMBER cell that can be represented as an integer will be, but this means that NUMBER columns can contain mixed types: Int and Float.

e.g. ["1", "1.0", "1.1"] will be parsed as [Int(1), Int(1), Float(1.1)]

§

Float(f64)

A 64-bit floating point number, 15 digits of precision. Any NUMBER cell that cannot be represented as an integer will be parsed as a float. Additionally, all REAL columns will be parsed as floats. This is lossy, but intended for convenience.

§

Varchar(String)

A variable length string. It must be valid UTF-8.

§

Binary(Vec<u8>)

A variable length binary string. (This is serialized over the wire as a hex string, so these are not bandwidth efficient.)

§

Boolean(bool)

A boolean value.

§

Date(NaiveDate)

A date without a time zone.

§

Time(NaiveTime)

A time without a time zone.

§

TimestampLtz(DateTime<Local>)

A timestamp with the local time zone. (This is not extensively tested)

§

TimestampNtz(NaiveDateTime)

A timestamp without a time zone. Presumably this is UTC, but it is not specified.

Trait Implementations§

source§

impl Clone for Cell

source§

fn clone(&self) -> Cell

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Cell

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Cell> for Value

source§

fn from(cell: Cell) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Cell

§

impl Send for Cell

§

impl Sync for Cell

§

impl Unpin for Cell

§

impl UnwindSafe for Cell

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more