[][src]Struct odbc_api::parameter::VarChar

pub struct VarChar<'a> { /* fields omitted */ }

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> VarChar<'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 VarChar<'_>[src]

impl<'_> Input for VarChar<'_>[src]

impl<'_> Parameter for VarChar<'_>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for VarChar<'a>

impl<'a> Send for VarChar<'a>

impl<'a> Sync for VarChar<'a>

impl<'a> Unpin for VarChar<'a>

impl<'a> UnwindSafe for VarChar<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.