pub struct SqlArg<'a, S: UdfState> { /* private fields */ }
Expand description
A single SQL argument, including its attributes
This struct contains the argument itself. It uses a typestate pattern (S
)
to have slightly different functionality when used during initialization and
during processing.
Implementations§
source§impl<'a> SqlArg<'a, Init>
impl<'a> SqlArg<'a, Init>
This includes functions that are only applicable during initialization
sourcepub fn is_const(&self) -> bool
pub fn is_const(&self) -> bool
Determine whether an argument may be constant
During initialization, a value is const if it is not None
. This
provides a simple test to see if this is true.
There is no way to differentiate between “not const” and “const but
NULL” when we are in the Process
step.
sourcepub fn maybe_null(&self) -> bool
pub fn maybe_null(&self) -> bool
Whether or not this argument may be NULL
sourcepub fn set_type_coercion(&mut self, newtype: SqlType)
pub fn set_type_coercion(&mut self, newtype: SqlType)
Instruct the SQL application to coerce the argument’s type. This does
not change the underlying value visible in .value
.
sourcepub fn get_type_coercion(&self) -> SqlType
pub fn get_type_coercion(&self) -> SqlType
Retrieve the current type coercision
Trait Implementations§
Auto Trait Implementations§
impl<'a, S> !RefUnwindSafe for SqlArg<'a, S>
impl<'a, S> !Send for SqlArg<'a, S>
impl<'a, S> !Sync for SqlArg<'a, S>
impl<'a, S> Unpin for SqlArg<'a, S>where S: Unpin,
impl<'a, S> !UnwindSafe for SqlArg<'a, S>
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