[−][src]Struct odbc_api::parameter::VarChar
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]
pub fn cdata_type(&self) -> CDataType
[src]
pub fn indicator_ptr(&self) -> *const isize
[src]
pub fn value_ptr(&self) -> *const c_void
[src]
pub fn buffer_length(&self) -> isize
[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]
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>,