Skip to main content

ValueRef

Struct ValueRef 

Source
pub struct ValueRef<'a> { /* private fields */ }
Available on crate features functions or value only.
Expand description

A thin wrapper around a sqlite3_value reference.

ValueRef is used only to represent protected sqlite3_value objects, such as those passed to user-defined functions or those returned by sqlite3_value_dup. OpaqueValueRef is instead used to represent the unprotected values returned from sqlite3_column_* functions.

Implementations§

Source§

impl<'a> ValueRef<'a>

Source

pub const fn new(handle: *mut sqlite3_value) -> Option<Self>

Available on crate feature value only.

Wrap a sqlite3_value dynamic value object.

Source

pub unsafe fn fetch<'r, T: Fetch<'r>>(&'r self) -> T

Available on crate feature value only.

Unpack a typed value from this Value.

§Safety

Callers are responsible for managing the ffi::Value lifecycle.

Source

pub const fn as_ptr(&self) -> *mut sqlite3_value

Available on crate feature value only.

Access the raw sqlite3_value pointer.

Trait Implementations§

Source§

impl<'a> AsRef<ValueRef<'a>> for Value

Available on crate feature value only.
Source§

fn as_ref(&self) -> &ValueRef<'a>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> Borrow<ValueRef<'a>> for Value

Available on crate feature value only.
Source§

fn borrow(&self) -> &ValueRef<'a>

Immutably borrows from an owned value. Read more
Source§

impl Debug for ValueRef<'_>

Available on crate feature value only.
Source§

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

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

impl<'a> ToOwned for ValueRef<'a>

Available on crate feature value only.
Source§

type Owned = Value

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

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

impl<'c> Send for ValueRef<'c>

Available on crate features multi-thread or serialized only.
Source§

impl<'c> Sync for ValueRef<'c>

Available on crate feature serialized only.

Auto Trait Implementations§

§

impl<'a> Freeze for ValueRef<'a>

§

impl<'a> RefUnwindSafe for ValueRef<'a>

§

impl<'a> Unpin for ValueRef<'a>

§

impl<'a> UnsafeUnpin for ValueRef<'a>

§

impl<'a> UnwindSafe for ValueRef<'a>

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, 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.