pub struct AnyColumnBufferSlice<'a> { /* private fields */ }Expand description
Enables reading the valid contents of a column buffer, while it is bound to a block cursor
as [BoxColumnBuffer>].
Implementations§
Source§impl<'a> AnyColumnBufferSlice<'a>
impl<'a> AnyColumnBufferSlice<'a>
Sourcepub fn of<T>(self) -> Option<T::Slice<'a>>where
T: Slice + 'static,
pub fn of<T>(self) -> Option<T::Slice<'a>>where
T: Slice + 'static,
Fetch the associated slice if we know the underlying buffer to be of type T. Usually it is
more convenient to use methods which some amount of knowledge about the buffer types used by
this crate. I.e. it is better to use Self::as_text, Self::as_wide_text,
Self::as_binary, Self::as_slice or Self::as_nullable_slice instead. The
exception would be if you use a custom column buffer type provided by your application
rather than odbc-api itself.
Sourcepub fn as_text(self) -> Option<TextColumnSlice<'a, u8>>
pub fn as_text(self) -> Option<TextColumnSlice<'a, u8>>
Use this if you know the underlying buffer holds narrow (e.g. UTF-8) character data and you want to read it.
Some if the the underlying buffer is of type TextColumn with u8 values. Same as
Self::of::<TextColumn<u8>>.
Sourcepub fn as_wide_text(self) -> Option<TextColumnSlice<'a, u16>>
pub fn as_wide_text(self) -> Option<TextColumnSlice<'a, u16>>
Use this if you know the underlying buffer holds wide (i.e. UTF-16) character data and you want to read it.
Some if the the underlying buffer is of type TextColumn with u16 values. Same as
Self::of::<TextColumn<u16>>.
Sourcepub fn as_binary(self) -> Option<BinColumnSlice<'a>>
pub fn as_binary(self) -> Option<BinColumnSlice<'a>>
Use this if you know the underlying buffer holds binary data and you want to read it.
Some if the the underlying buffer is of type BinColumn. Same as
Self::of::<BinColumn>.
Sourcepub fn as_slice<T>(self) -> Option<&'a [T]>where
T: Pod,
pub fn as_slice<T>(self) -> Option<&'a [T]>where
T: Pod,
Use this if you know the underlying buffer to hold non-nullable data of type T.
Sourcepub fn as_nullable_slice<T>(self) -> Option<NullableSlice<'a, T>>where
T: Pod,
pub fn as_nullable_slice<T>(self) -> Option<NullableSlice<'a, T>>where
T: Pod,
Use this if you know the underlying buffer to hold nullable data of type T.
Trait Implementations§
Source§impl<'a> Clone for AnyColumnBufferSlice<'a>
impl<'a> Clone for AnyColumnBufferSlice<'a>
Source§fn clone(&self) -> AnyColumnBufferSlice<'a>
fn clone(&self) -> AnyColumnBufferSlice<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more