Trait svc_storage::resources::base::Resource
source · pub trait Resourcewhere
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§
sourcefn get_definition() -> ResourceDefinition
fn get_definition() -> ResourceDefinition
Allows us to implement the resource definition used for simple insert and update queries
Provided Methods§
sourcefn get_enum_string_val(field: &str, value: i32) -> Option<String>
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).
sourcefn get_table_indices() -> Vec<String>
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).
sourcefn has_id_col(id_col: &str) -> bool
fn has_id_col(id_col: &str) -> bool
Returns true
if the given column name is part of the resource’s combined id
sourcefn get_psql_table() -> String
fn get_psql_table() -> String
Returns the psql_table
String value of the resource’s ResourceDefinition
Object Safety§
This trait is not object safe.