Skip to main content
pub enum RecordValue 
    Null,
    Int(i32),
    Long(i64),
    Float(f32),
    Double(f64),
    String(String),
    Bytes(Vec<u8>),

A typed value that can be stored in a GenericRecord.

Variants

Null

Null value

Int(i32)

32-bit integer (also used for boolean, int8, int16)

Long(i64)

64-bit integer (also used for timestamp)

Float(f32)

32-bit float

Double(f64)

64-bit double

String(String)

String (also used for date, time, datetime, char, uuid, ipv4, decimal)

Bytes(Vec<u8>)

Raw bytes

Implementations

Source

pub fn is_null(&self) -> bool

Check if this value is null.

Source

pub fn as_int(&self) -> Option<i32>

Get as i32 if applicable.

Source

pub fn as_long(&self) -> Option<i64>

Get as i64 if applicable.

Source

pub fn as_float(&self) -> Option<f32>

Get as f32 if applicable.

Source

pub fn as_double(&self) -> Option<f64>

Get as f64 if applicable.

Source

pub fn as_string(&self) -> Option<&str>

Get as string if applicable.

Source

pub fn as_bytes(&self) -> Option<&[u8]>

Get as bytes if applicable.

Source

pub fn as_bool(&self) -> Option<bool>

Get as boolean (from int).

Trait Implementations

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source

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

Performs copy-assignment from source. Read more
Source

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

Formats the value using the given formatter. Read more
Source

fn from(v: &str) -> Self

Converts to this type from the input type.
Source

fn from(v: Option<T>) -> Self

Converts to this type from the input type.
Source

fn from(v: String) -> Self

Converts to this type from the input type.
Source

fn from(v: Vec<u8>) -> Self

Converts to this type from the input type.
Source

fn from(v: bool) -> Self

Converts to this type from the input type.
Source

fn from(v: f32) -> Self

Converts to this type from the input type.
Source

fn from(v: f64) -> Self

Converts to this type from the input type.
Source

fn from(v: i32) -> Self

Converts to this type from the input type.
Source

fn from(v: i64) -> Self

Converts to this type from the input type.
Source

fn eq(&self, other: &RecordValue) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.