Trait FromAthena

Source
pub trait FromAthena: Sized {
    // Required method
    fn from_athena(values: HashMap<String, String>) -> Result<Self, Error>;
}
Expand description

A trait for converting data from an Athena query result into a specified type.

This trait defines a method from_athena which converts a HashMap of string key-value pairs representing data retrieved from an Athena query into an instance of the implementing type. The conversion process may involve parsing, validation, or any other necessary transformation.

§Errors

If the conversion process fails due to invalid or missing data, an error is returned.

§Examples

Implementing FromAthena for a custom struct:

Required Methods§

Source

fn from_athena(values: HashMap<String, String>) -> Result<Self, Error>

Converts a HashMap of string key-value pairs into an instance of the implementing type.

§Arguments
  • values - A HashMap containing the data to be converted.
§Returns

Result containing the converted instance of the implementing type or an error if conversion fails.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§