pub struct Struct<'a> { /* private fields */ }

Implementations§

Examples found in repository?
src/row.rs (line 244)
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
    fn try_from(item: &Value, field: &Field) -> Result<Self, Error> {
        let maybe_array = match field.r#type.as_ref() {
            None => return Err(Error::StructParseError(field.name.to_string(), "field type must not be none")),
            Some(tp) => tp.array_element_type.as_ref(),
        };
        let maybe_struct_type = match maybe_array {
            None => return Err(Error::StructParseError(field.name.to_string(), "array must not be none")),
            Some(tp) => tp.struct_type.as_ref(),
        };
        let struct_type = match maybe_struct_type {
            None => {
                return Err(Error::StructParseError(
                    field.name.to_string(),
                    "struct type in array must not be none ",
                ))
            }
            Some(struct_type) => struct_type,
        };

        T::try_from_struct(Struct::new(struct_type, item, field)?)
    }
Examples found in repository?
src/row.rs (line 134)
130
131
132
133
134
135
    pub fn column_by_name<T>(&self, column_name: &str) -> Result<T, Error>
    where
        T: TryFromValue,
    {
        self.column(index(&self.index, column_name)?)
    }

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Wrap the input message T in a tonic::Request
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more