pub enum SQLParam {
Scalar(Value),
TypedScalar {
value: Value,
ty: ColumnType,
},
Vector(Vec<f32>),
Tensor(Vec<Vec<f32>>),
}Expand description
Value bound to a $N placeholder.
Variants§
Scalar(Value)
TypedScalar
A scalar value whose declared SQL type must survive runtime Value carrier normalization.
Vector(Vec<f32>)
Tensor(Vec<Vec<f32>>)
Implementations§
Source§impl SQLParam
impl SQLParam
pub fn scalar(value: Value) -> Self
pub fn typed_scalar(value: Value, ty: ColumnType) -> Self
Sourcepub fn scalar_value(&self) -> Option<&Value>
pub fn scalar_value(&self) -> Option<&Value>
Return the scalar carrier without changing the semantics of untyped SQLParam::Scalar values.
Sourcepub fn declared_scalar_type(&self) -> Option<&ColumnType>
pub fn declared_scalar_type(&self) -> Option<&ColumnType>
Return the explicit SQL type carried only by SQLParam::TypedScalar.
Sourcepub fn to_value(&self) -> Result<Value, SQLError>
pub fn to_value(&self) -> Result<Value, SQLError>
Materialize the parameter carrier with ordinary SQL value semantics.
Sourcepub fn to_value_with_control(
&self,
control: &ProductionControl<'_>,
) -> Result<Produced<Value>, SQLError>
pub fn to_value_with_control( &self, control: &ProductionControl<'_>, ) -> Result<Produced<Value>, SQLError>
Copy a borrowed parameter while retaining every container and child payload under its producer’s allowance.
pub fn vector(v: Vec<f32>) -> Self
pub fn tensor(v: Vec<Vec<f32>>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SQLParam
impl RefUnwindSafe for SQLParam
impl Send for SQLParam
impl Sync for SQLParam
impl Unpin for SQLParam
impl UnsafeUnpin for SQLParam
impl UnwindSafe for SQLParam
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more