odbc_api::buffers

Enum AnySlice

Source
pub enum AnySlice<'a> {
Show 25 variants Text(TextColumnView<'a, u8>), WText(TextColumnView<'a, u16>), Binary(BinColumnView<'a>), Date(&'a [Date]), Time(&'a [Time]), Timestamp(&'a [Timestamp]), F64(&'a [f64]), F32(&'a [f32]), I8(&'a [i8]), I16(&'a [i16]), I32(&'a [i32]), I64(&'a [i64]), U8(&'a [u8]), Bit(&'a [Bit]), NullableDate(NullableSlice<'a, Date>), NullableTime(NullableSlice<'a, Time>), NullableTimestamp(NullableSlice<'a, Timestamp>), NullableF64(NullableSlice<'a, f64>), NullableF32(NullableSlice<'a, f32>), NullableI8(NullableSlice<'a, i8>), NullableI16(NullableSlice<'a, i16>), NullableI32(NullableSlice<'a, i32>), NullableI64(NullableSlice<'a, i64>), NullableU8(NullableSlice<'a, u8>), NullableBit(NullableSlice<'a, Bit>),
}
Expand description

A borrowed view on the valid rows in a column of a crate::buffers::ColumnarBuffer.

For columns of fixed size types, which are guaranteed to not contain null, a direct access to the slice is offered. Buffers over nullable columns can be accessed via an iterator over options.

Variants§

§

Text(TextColumnView<'a, u8>)

Nullable character data in the system encoding.

§

WText(TextColumnView<'a, u16>)

Nullable character data encoded in UTF-16.

§

Binary(BinColumnView<'a>)

§

Date(&'a [Date])

§

Time(&'a [Time])

§

Timestamp(&'a [Timestamp])

§

F64(&'a [f64])

§

F32(&'a [f32])

§

I8(&'a [i8])

§

I16(&'a [i16])

§

I32(&'a [i32])

§

I64(&'a [i64])

§

U8(&'a [u8])

§

Bit(&'a [Bit])

§

NullableDate(NullableSlice<'a, Date>)

§

NullableTime(NullableSlice<'a, Time>)

§

NullableTimestamp(NullableSlice<'a, Timestamp>)

§

NullableF64(NullableSlice<'a, f64>)

§

NullableF32(NullableSlice<'a, f32>)

§

NullableI8(NullableSlice<'a, i8>)

§

NullableI16(NullableSlice<'a, i16>)

§

NullableI32(NullableSlice<'a, i32>)

§

NullableI64(NullableSlice<'a, i64>)

§

NullableU8(NullableSlice<'a, u8>)

§

NullableBit(NullableSlice<'a, Bit>)

Implementations§

Source§

impl<'a> AnySlice<'a>

Source

pub fn as_text_view(self) -> Option<TextColumnView<'a, u8>>

This method is useful if you expect the variant to be AnySlice::Text. It allows you to unwrap the inner column view without explictly matching it.

Source

pub fn as_w_text_view(self) -> Option<TextColumnView<'a, u16>>

This method is useful if you expect the variant to be AnySlice::WText. It allows you to unwrap the inner column view without explictly matching it.

Source

pub fn as_bin_view(self) -> Option<BinColumnView<'a>>

This method is useful if you expect the variant to be AnySlice::Binary. It allows you to unwrap the inner column view without explictly matching it.

Source

pub fn as_slice<I: Item>(self) -> Option<&'a [I]>

Extract the array type from an AnySlice.

Source

pub fn as_nullable_slice<I: Item>(self) -> Option<NullableSlice<'a, I>>

Extract the typed nullable buffer from an AnySlice.

Trait Implementations§

Source§

impl<'a> Clone for AnySlice<'a>

Source§

fn clone(&self) -> AnySlice<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for AnySlice<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> Copy for AnySlice<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for AnySlice<'a>

§

impl<'a> RefUnwindSafe for AnySlice<'a>

§

impl<'a> Send for AnySlice<'a>

§

impl<'a> Sync for AnySlice<'a>

§

impl<'a> Unpin for AnySlice<'a>

§

impl<'a> UnwindSafe for AnySlice<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.