Struct odbc_api::parameter::VarCharRef [−][src]
Binds a byte array as a VarChar input parameter.
While a byte array can provide us with a pointer to the start of the array and the length of the array itself, it can not provide us with a pointer to the length of the buffer. So to bind strings which are not zero terminated we need to store the length in a separate value.
This type is created if into_parameter of the IntoParameter trait is called on a &str.
Example
use odbc_api::{Environment, IntoParameter}; let env = unsafe { Environment::new()? }; let mut conn = env.connect("YourDatabase", "SA", "<YourStrong@Passw0rd>")?; if let Some(cursor) = conn.execute( "SELECT year FROM Birthdays WHERE name=?;", &"Bernd".into_parameter())? { // Use cursor to process query results. };
Implementations
impl<'a> VarCharRef<'a>[src]
pub fn new(value: &'a [u8]) -> Self[src]
Constructs a new VarChar containing the text in the specified buffer.
pub fn null() -> Self[src]
Constructs a new VarChar representing the NULL value.
Trait Implementations
impl CData for VarCharRef<'_>[src]
fn cdata_type(&self) -> CDataType[src]
fn indicator_ptr(&self) -> *const isize[src]
fn value_ptr(&self) -> *const c_void[src]
fn buffer_length(&self) -> isize[src]
impl HasDataType for VarCharRef<'_>[src]
impl InputParameter for VarCharRef<'_>[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for VarCharRef<'a>
impl<'a> Send for VarCharRef<'a>
impl<'a> Sync for VarCharRef<'a>
impl<'a> Unpin for VarCharRef<'a>
impl<'a> UnwindSafe for VarCharRef<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,