pub enum SQLParam {
Scalar(Value),
TypedScalar {
value: Value,
ty: ColumnType,
},
Vector(Vec<f32>),
Tensor(Vec<Vec<f32>>),
TypedTensor(SQLTensor),
// some variants omitted
}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>>)
TypedTensor(SQLTensor)
A validated packed tensor whose declared dimension survives an empty row set.
Implementations§
Source§impl SQLParam
impl SQLParam
Sourcepub fn uuid_with_control(
bytes: [u8; 16],
control: &ProductionControl<'_>,
) -> Result<Produced<Self>, SQLError>
pub fn uuid_with_control( bytes: [u8; 16], control: &ProductionControl<'_>, ) -> Result<Produced<Self>, SQLError>
Construct a UUID from canonical network-order octets without applying version or variant restrictions.
Sourcepub fn packed_bits_with_control(
bytes: &[u8],
bit_length: u32,
kind: BitStringKind,
control: &ProductionControl<'_>,
) -> Result<Produced<Self>, SQLError>
pub fn packed_bits_with_control( bytes: &[u8], bit_length: u32, kind: BitStringKind, control: &ProductionControl<'_>, ) -> Result<Produced<Self>, SQLError>
Copy a packed fixed or varying bit value with no declared length modifier. Logical length and SQL kind remain independent.
Source§impl SQLParam
impl SQLParam
Sourcepub fn tensor_with_control(
values: &[f32],
dimensions: u32,
control: &ProductionControl<'_>,
) -> Result<Produced<Self>, SQLError>
pub fn tensor_with_control( values: &[f32], dimensions: u32, control: &ProductionControl<'_>, ) -> Result<Produced<Self>, SQLError>
Construct a typed tensor from packed row-major floats, retaining its dimension even when no rows are present.
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 an explicit scalar type, including a deferred procedural error’s retained type.
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
Sourcepub fn vector_with_control(
values: &[f32],
control: &ProductionControl<'_>,
) -> Result<Produced<Self>, SQLError>
pub fn vector_with_control( values: &[f32], control: &ProductionControl<'_>, ) -> Result<Produced<Self>, SQLError>
Copy a host vector after validating its SQL dimension and finite float32 elements. The completed parameter retains the caller’s original allowance.
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
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> ⓘ
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> ⓘ
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