Struct spanner_rs::StructType
source · [−]pub struct StructType(_);
Expand description
The Cloud Spanner Struct
type which is composed of optionally named fields and their data type.
Implementations
sourceimpl StructType
impl StructType
sourcepub fn new(fields: Vec<(&str, Type)>) -> Self
pub fn new(fields: Vec<(&str, Type)>) -> Self
Creates a new StructType
with the provided fields.
Note that Cloud Spanner allows “unnamed” fields. If a provided field name is the empty string,
it will be converted to a None
in the resulting StructType
.
sourcepub fn fields(&self) -> &Vec<(Option<String>, Type)>
pub fn fields(&self) -> &Vec<(Option<String>, Type)>
Returns a reference to this struct’s fields.
sourcepub fn field_names(&self) -> impl Iterator<Item = &Option<String>>
pub fn field_names(&self) -> impl Iterator<Item = &Option<String>>
Returns an iterator over the names of this struct’s fields.
sourcepub fn types(&self) -> impl Iterator<Item = &Type>
pub fn types(&self) -> impl Iterator<Item = &Type>
Returns an iterator over the types of this struct’s fields.
sourcepub fn field_index(&self, field_name: &str) -> Option<usize>
pub fn field_index(&self, field_name: &str) -> Option<usize>
Returns the index of the provided field name.
Returns None
if no field matches the provided name.
Note that this function ignores unnamed fields.
Trait Implementations
sourceimpl Clone for StructType
impl Clone for StructType
sourcefn clone(&self) -> StructType
fn clone(&self) -> StructType
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for StructType
impl Debug for StructType
sourceimpl Default for StructType
impl Default for StructType
sourcefn default() -> StructType
fn default() -> StructType
Returns the “default value” for a type. Read more
sourceimpl PartialEq<StructType> for StructType
impl PartialEq<StructType> for StructType
sourcefn eq(&self, other: &StructType) -> bool
fn eq(&self, other: &StructType) -> bool
sourceimpl TryFrom<&StructType> for StructType
impl TryFrom<&StructType> for StructType
sourceimpl TryFrom<StructType> for StructType
impl TryFrom<StructType> for StructType
impl StructuralPartialEq for StructType
Auto Trait Implementations
impl RefUnwindSafe for StructType
impl Send for StructType
impl Sync for StructType
impl Unpin for StructType
impl UnwindSafe for StructType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request