pub trait Resource
where Self: Sized,
{ // Required method fn get_definition() -> ResourceDefinition; // Provided methods fn get_enum_string_val(field: &str, value: i32) -> Option<String> { ... } fn get_table_indices() -> Vec<String> { ... } fn has_id_col(id_col: &str) -> bool { ... } fn get_psql_table() -> String { ... } }
Expand description

Generic trait providing useful functions for our resources

Required Methods§

source

fn get_definition() -> ResourceDefinition

Allows us to implement the resource definition used for simple insert and update queries

Provided Methods§

source

fn get_enum_string_val(field: &str, value: i32) -> Option<String>

This function should be implemented for the resources where applicable (example implementation can be found in the flight_plan module).

source

fn get_table_indices() -> Vec<String>

This function should be implemented for the resources where applicable (example implementation can be found in the flight_plan module).

source

fn has_id_col(id_col: &str) -> bool

Returns true if the given column name is part of the resource’s combined id

source

fn get_psql_table() -> String

Returns the psql_table String value of the resource’s ResourceDefinition

Object Safety§

This trait is not object safe.

Implementors§