pub enum Kind {
RawValue(Vec<u8>),
RawTimestampMicros(i64),
BytesValue(Vec<u8>),
StringValue(String),
IntValue(i64),
BoolValue(bool),
FloatValue(f64),
TimestampValue(Timestamp),
DateValue(Date),
ArrayValue(ArrayValue),
}
Expand description
Options for transporting values within the protobuf type system. A given
kind
may support more than one type
and vice versa. On write, this is
roughly analogous to a GoogleSQL literal.
The value is NULL
if none of the fields in kind
is set. If type
is
also omitted on write, we will infer it based on the schema.
Variants§
RawValue(Vec<u8>)
Represents a raw byte sequence with no type information.
The type
field must be omitted.
RawTimestampMicros(i64)
Represents a raw cell timestamp with no type information.
The type
field must be omitted.
BytesValue(Vec<u8>)
Represents a typed value transported as a byte sequence.
StringValue(String)
Represents a typed value transported as a string.
IntValue(i64)
Represents a typed value transported as an integer.
BoolValue(bool)
Represents a typed value transported as a boolean.
FloatValue(f64)
Represents a typed value transported as a floating point number.
TimestampValue(Timestamp)
Represents a typed value transported as a timestamp.
DateValue(Date)
Represents a typed value transported as a date.
ArrayValue(ArrayValue)
Represents a typed value transported as a sequence of values.
To differentiate between Struct
, Array
, and Map
, the outermost
Value
must provide an explicit type
on write. This type
will
apply recursively to the nested Struct
fields, Array
elements,
or Map
key/value pairs, which must not supply their own type
.
Implementations§
Source§impl Kind
impl Kind
Sourcepub fn merge(
field: &mut Option<Kind>,
tag: u32,
wire_type: WireType,
buf: &mut impl Buf,
ctx: DecodeContext,
) -> Result<(), DecodeError>
pub fn merge( field: &mut Option<Kind>, tag: u32, wire_type: WireType, buf: &mut impl Buf, ctx: DecodeContext, ) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into self.
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Trait Implementations§
impl StructuralPartialEq for Kind
Auto Trait Implementations§
impl Freeze for Kind
impl RefUnwindSafe for Kind
impl Send for Kind
impl Sync for Kind
impl Unpin for Kind
impl UnwindSafe for Kind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request