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.
Tuple Fields§
§0: u8
Implementations§
Trait Implementations§
Source§impl CData for Bit
impl CData for Bit
Source§fn cdata_type(&self) -> CDataType
fn cdata_type(&self) -> CDataType
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.Source§fn indicator_ptr(&self) -> *const isize
fn indicator_ptr(&self) -> *const isize
Indicates the length of variable sized types. May be zero for fixed sized types. Used to
determine the size or existence of input parameters.
Source§fn value_ptr(&self) -> *const c_void
fn value_ptr(&self) -> *const c_void
Pointer to a value corresponding to the one described by
cdata_type
.Source§fn buffer_length(&self) -> isize
fn buffer_length(&self) -> isize
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
.Source§impl CDataMut for Bit
impl CDataMut for Bit
Source§fn mut_indicator_ptr(&mut self) -> *mut isize
fn mut_indicator_ptr(&mut self) -> *mut isize
Indicates the length of variable sized types. May be zero for fixed sized types.
Source§fn mut_value_ptr(&mut self) -> *mut c_void
fn mut_value_ptr(&mut self) -> *mut c_void
Pointer to a value corresponding to the one described by cdata_type
.
Source§impl CElement for Bit
impl CElement for Bit
Source§fn assert_completness(&self)
fn assert_completness(&self)
Fixed sized types are always complete
Source§impl FetchRowMember for Bit
impl FetchRowMember for Bit
Source§fn indicator(&self) -> Option<Indicator>
fn indicator(&self) -> Option<Indicator>
Indicator for variable sized or nullable types,
None
for fixed sized types.Source§fn find_truncation(&self, buffer_index: usize) -> Option<TruncationInfo>
fn find_truncation(&self, buffer_index: usize) -> Option<TruncationInfo>
Some
if the indicator indicates truncation. Always None
for fixed sized types.Source§unsafe fn bind_to_col(
&mut self,
col_index: u16,
cursor: &mut StatementRef<'_>,
) -> Result<(), Error>
unsafe fn bind_to_col( &mut self, col_index: u16, cursor: &mut StatementRef<'_>, ) -> Result<(), Error>
Bind row element to column. Only called for the first row in a row wise buffer. Read more
Source§impl HasDataType for Bit
impl HasDataType for Bit
Source§impl Item for Bit
impl Item for Bit
Source§fn buffer_desc(nullable: bool) -> BufferDesc
fn buffer_desc(nullable: bool) -> BufferDesc
Can be used to instantiate a
super::ColumnarBuffer
. This is useful to allocate the
correct buffers in generic code. Read moreSource§fn as_slice(variant: AnySlice<'_>) -> Option<&[Self]>
fn as_slice(variant: AnySlice<'_>) -> Option<&[Self]>
Extract the array type from an
AnySlice
.Source§fn as_nullable_slice(variant: AnySlice<'_>) -> Option<NullableSlice<'_, Self>>
fn as_nullable_slice(variant: AnySlice<'_>) -> Option<NullableSlice<'_, Self>>
Extract the typed nullable buffer from an
AnySlice
.Source§fn as_slice_mut(variant: AnySliceMut<'_>) -> Option<&mut [Self]>
fn as_slice_mut(variant: AnySliceMut<'_>) -> Option<&mut [Self]>
Extract the array type from an
AnySliceMut
.Source§fn as_nullable_slice_mut(
variant: AnySliceMut<'_>,
) -> Option<NullableSliceMut<'_, Self>>
fn as_nullable_slice_mut( variant: AnySliceMut<'_>, ) -> Option<NullableSliceMut<'_, Self>>
Extract the typed nullable buffer from an
AnySliceMut
.Source§impl Ord for Bit
impl Ord for Bit
Source§impl PartialOrd for Bit
impl PartialOrd for Bit
impl Copy for Bit
impl Eq for Bit
impl OutputParameter for Bit
impl StructuralPartialEq for Bit
Auto Trait Implementations§
impl Freeze for Bit
impl RefUnwindSafe for Bit
impl Send for Bit
impl Sync for Bit
impl Unpin for Bit
impl UnwindSafe for Bit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<T> IntoParameter for Twhere
T: InputParameter,
impl<T> IntoParameter for Twhere
T: InputParameter,
type Parameter = T
fn into_parameter(self) -> <T as IntoParameter>::Parameter
Source§impl<T> ParameterCollection for Twhere
T: InputParameterCollection + ?Sized,
impl<T> ParameterCollection for Twhere
T: InputParameterCollection + ?Sized,
Source§fn parameter_set_size(&self) -> usize
fn parameter_set_size(&self) -> usize
Number of values per parameter in the collection. This can be different from the maximum
batch size a buffer may be able to hold. Returning
0
will cause the the query not to be
executed.