Struct odbc_api::Bit[][src]

pub struct Bit(pub u8);
Expand description

New type wrapping u8 and binding as SQL_BIT.

If rust would guarantee the representation of bool to be an u8, bool would be the obvious choice instead. Alas it is not and someday on some platform bool might be something else than a u8 so let’s use this new type instead.

Implementations

impl Bit[src]

pub fn as_bool(self) -> bool[src]

Maps 1 to true, 0 to false. Panics if Bit should be invalid (not 0 or 1).

Trait Implementations

impl CData for Bit[src]

fn cdata_type(&self) -> CDataType[src]

The identifier of the C data type of the value buffer. When it is retrieving data from the data source with fetch, the driver converts the data to this type. When it sends data to the source, the driver converts the data from this type. Read more

fn indicator_ptr(&self) -> *const isize[src]

Indicates the length of variable sized types. May be zero for fixed sized types.

fn value_ptr(&self) -> *const c_void[src]

Pointer to a value corresponding to the one described by cdata_type.

fn buffer_length(&self) -> isize[src]

Maximum length of the type in bytes (not characters). It is required to index values in bound buffers, if more than one parameter is bound. Can be set to zero for types not bound as parameter arrays, i.e. CStr. Read more

impl Clone for Bit[src]

fn clone(&self) -> Bit[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Bit[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Bit[src]

fn default() -> Bit[src]

Returns the “default value” for a type. Read more

impl HasDataType for Bit[src]

fn data_type(&self) -> DataType[src]

The SQL data as which the parameter is bound to ODBC.

impl Ord for Bit[src]

fn cmp(&self, other: &Bit) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl PartialEq<Bit> for Bit[src]

fn eq(&self, other: &Bit) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Bit) -> bool[src]

This method tests for !=.

impl PartialOrd<Bit> for Bit[src]

fn partial_cmp(&self, other: &Bit) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Copy for Bit[src]

impl Eq for Bit[src]

impl InputParameter for Bit[src]

impl StructuralEq for Bit[src]

impl StructuralPartialEq for Bit[src]

Auto Trait Implementations

impl RefUnwindSafe for Bit

impl Send for Bit

impl Sync for Bit

impl Unpin for Bit

impl UnwindSafe for Bit

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.