Enum libsql::Value

source ·
pub enum Value {
    Null,
    Integer(i64),
    Real(f64),
    Text(String),
    Blob(Vec<u8>),
}

Variants§

§

Null

§

Integer(i64)

§

Real(f64)

§

Text(String)

§

Blob(Vec<u8>)

Implementations§

source§

impl Value

source

pub fn is_null(&self) -> bool

Returns true if the value is Null.

source

pub fn is_integer(&self) -> bool

Returns true if the value is Integer.

source

pub fn is_real(&self) -> bool

Returns true if the value is Real.

source

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

source

pub fn is_text(&self) -> bool

Returns true if the value is Text.

source

pub fn as_text(&self) -> Option<&String>

source

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

source

pub fn is_blob(&self) -> bool

Returns true if the value is Blob.

source

pub fn as_blob(&self) -> Option<&Vec<u8>>

Trait Implementations§

source§

impl Clone for Value

source§

fn clone(&self) -> Value

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 Value

source§

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

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

impl<'de> Deserialize<'de> for Value

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<&[u8]> for Value

source§

fn from(value: &[u8]) -> Value

Converts to this type from the input type.
source§

impl<'a> From<&'a Value> for ValueRef<'a>

source§

fn from(v: &'a Value) -> ValueRef<'a>

Converts to this type from the input type.
source§

impl From<&str> for Value

source§

fn from(value: &str) -> Value

Converts to this type from the input type.
source§

impl<T> From<Option<T>> for Value
where T: Into<Value>,

source§

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

Converts to this type from the input type.
source§

impl From<String> for Value

source§

fn from(value: String) -> Value

Converts to this type from the input type.
source§

impl From<Value> for Value

source§

fn from(value: Value) -> Value

Converts to this type from the input type.
source§

impl From<ValueRef<'_>> for Value

source§

fn from(vr: ValueRef<'_>) -> Value

Converts to this type from the input type.
source§

impl From<Vec<u8>> for Value

source§

fn from(value: Vec<u8>) -> Value

Converts to this type from the input type.
source§

impl From<bool> for Value

source§

fn from(value: bool) -> Value

Converts to this type from the input type.
source§

impl From<f32> for Value

source§

fn from(value: f32) -> Value

Converts to this type from the input type.
source§

impl From<f64> for Value

source§

fn from(value: f64) -> Value

Converts to this type from the input type.
source§

impl From<i16> for Value

source§

fn from(value: i16) -> Value

Converts to this type from the input type.
source§

impl From<i32> for Value

source§

fn from(value: i32) -> Value

Converts to this type from the input type.
source§

impl From<i64> for Value

source§

fn from(value: i64) -> Value

Converts to this type from the input type.
source§

impl From<i8> for Value

source§

fn from(value: i8) -> Value

Converts to this type from the input type.
source§

impl From<u16> for Value

source§

fn from(value: u16) -> Value

Converts to this type from the input type.
source§

impl From<u32> for Value

source§

fn from(value: u32) -> Value

Converts to this type from the input type.
source§

impl From<u8> for Value

source§

fn from(value: u8) -> Value

Converts to this type from the input type.
source§

impl<'de, E: Error> IntoDeserializer<'de, E> for Value

§

type Deserializer = ValueDeserializer<E>

The type of the deserializer being converted into.
source§

fn into_deserializer(self) -> Self::Deserializer

Convert this value into a deserializer.
source§

impl PartialEq for Value

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Value

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&Value> for Value

§

type Error = Error

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

fn try_from(value: &Value) -> Result<Self>

Performs the conversion.
source§

impl TryFrom<u64> for Value

§

type Error = Error

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

fn try_from(value: u64) -> Result<Value>

Performs the conversion.
source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

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.

source§

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

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

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

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

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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> IntoValue for T
where T: TryInto<Value>, <T as TryInto<Value>>::Error: Into<Box<dyn Error + Send + Sync>>,

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.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,