pub struct ColumnSpecs<'slice, 'spec> { /* private fields */ }
Expand description
A view over specification of columns returned by the database.
Implementations§
Source§impl<'slice, 'spec> ColumnSpecs<'slice, 'spec>
impl<'slice, 'spec> ColumnSpecs<'slice, 'spec>
Sourcepub fn new(specs: &'slice [ColumnSpec<'spec>]) -> Self
pub fn new(specs: &'slice [ColumnSpec<'spec>]) -> Self
Creates new ColumnSpecs
wrapper from a slice.
Sourcepub fn as_slice(&self) -> &'slice [ColumnSpec<'spec>]
pub fn as_slice(&self) -> &'slice [ColumnSpec<'spec>]
Returns a slice of col specs encompassed by this struct.
Sourcepub fn get_by_index(&self, k: usize) -> Option<&'slice ColumnSpec<'spec>>
pub fn get_by_index(&self, k: usize) -> Option<&'slice ColumnSpec<'spec>>
Returns specification of k-th column returned from the database.
Sourcepub fn get_by_name(
&self,
name: &str,
) -> Option<(usize, &'slice ColumnSpec<'spec>)>
pub fn get_by_name( &self, name: &str, ) -> Option<(usize, &'slice ColumnSpec<'spec>)>
Returns specification of the column with given name returned from the database.
Sourcepub fn iter(&self) -> impl Iterator<Item = &'slice ColumnSpec<'spec>>
pub fn iter(&self) -> impl Iterator<Item = &'slice ColumnSpec<'spec>>
Returns iterator over specification of columns returned from the database, ordered by column order in the response.
Trait Implementations§
Source§impl<'slice, 'spec> Clone for ColumnSpecs<'slice, 'spec>
impl<'slice, 'spec> Clone for ColumnSpecs<'slice, 'spec>
Source§fn clone(&self) -> ColumnSpecs<'slice, 'spec>
fn clone(&self) -> ColumnSpecs<'slice, 'spec>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'slice, 'spec> Debug for ColumnSpecs<'slice, 'spec>
impl<'slice, 'spec> Debug for ColumnSpecs<'slice, 'spec>
impl<'slice, 'spec> Copy for ColumnSpecs<'slice, 'spec>
Auto Trait Implementations§
impl<'slice, 'spec> Freeze for ColumnSpecs<'slice, 'spec>
impl<'slice, 'spec> RefUnwindSafe for ColumnSpecs<'slice, 'spec>
impl<'slice, 'spec> Send for ColumnSpecs<'slice, 'spec>
impl<'slice, 'spec> Sync for ColumnSpecs<'slice, 'spec>
impl<'slice, 'spec> Unpin for ColumnSpecs<'slice, 'spec>
impl<'slice, 'spec> UnwindSafe for ColumnSpecs<'slice, 'spec>
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more