pub struct TextColumnView<'c, C> { /* private fields */ }
Expand description
Allows read only access to the valid part of a text column.
You may ask, why is this type required, should we not just be able to use &TextColumn
? The
problem with TextColumn
is, that it is a buffer, but it has no idea how many of its members
are actually valid, and have been returned with the last row group of the the result set. That
number is maintained on the level of the entire column buffer. So a text column knows the number
of valid rows, in addition to holding a reference to the buffer, in order to guarantee, that
every element acccessed through it, is valid.
Implementations§
Source§impl<'c, C> TextColumnView<'c, C>
impl<'c, C> TextColumnView<'c, C>
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True if, and only if there are no valid rows in the column buffer.
Sourcepub fn get(&self, index: usize) -> Option<&'c [C]>
pub fn get(&self, index: usize) -> Option<&'c [C]>
Slice of text at the specified row index without terminating zero.
Sourcepub fn iter(&self) -> TextColumnIt<'c, C>
pub fn iter(&self) -> TextColumnIt<'c, C>
Iterator over the valid elements of the text buffer
Sourcepub fn content_length_at(&self, row_index: usize) -> Option<usize>
pub fn content_length_at(&self, row_index: usize) -> Option<usize>
Length of value at the specified position. This is different from an indicator as it refers to the length of the value in the buffer, not to the length of the value in the datasource. The two things are different for truncated values.
Sourcepub fn raw_value_buffer(&self) -> &'c [C]
pub fn raw_value_buffer(&self) -> &'c [C]
Provides access to the raw underlying value buffer. Normal applications should have little reason to call this method. Yet it may be useful for writing bindings which copy directly from the ODBC in memory representation into other kinds of buffers.
The buffer contains the bytes for every non null valid element, padded to the maximum string
length. The content of the padding bytes is undefined. Usually ODBC drivers write a
terminating zero at the end of each string. For the actual value length call
Self::content_length_at
. Any element starts at index * (Self::max_len
+ 1).
pub fn max_len(&self) -> usize
Sourcepub fn has_truncated_values(&self) -> Option<Indicator>
pub fn has_truncated_values(&self) -> Option<Indicator>
Some
if any value is truncated.
After fetching data we may want to know if any value has been truncated due to the buffer not being able to hold elements of that size. This method checks the indicator buffer element wise.
Trait Implementations§
Source§impl<'c, C: Clone> Clone for TextColumnView<'c, C>
impl<'c, C: Clone> Clone for TextColumnView<'c, C>
Source§fn clone(&self) -> TextColumnView<'c, C>
fn clone(&self) -> TextColumnView<'c, C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'c, C: Debug> Debug for TextColumnView<'c, C>
impl<'c, C: Debug> Debug for TextColumnView<'c, C>
impl<'c, C: Copy> Copy for TextColumnView<'c, C>
Auto Trait Implementations§
impl<'c, C> Freeze for TextColumnView<'c, C>
impl<'c, C> RefUnwindSafe for TextColumnView<'c, C>where
C: RefUnwindSafe,
impl<'c, C> Send for TextColumnView<'c, C>where
C: Sync,
impl<'c, C> Sync for TextColumnView<'c, C>where
C: Sync,
impl<'c, C> Unpin for TextColumnView<'c, C>
impl<'c, C> UnwindSafe for TextColumnView<'c, C>where
C: RefUnwindSafe,
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
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)
clone_to_uninit
)