pub trait FieldMapper: Clone {
// Required methods
fn map_fields(&mut self, fields: Vec<TableField>);
fn get_field_id(&self, name: &str) -> Option<u64>;
fn get_field_name(&self, id: u64) -> Option<String>;
fn get_fields(&self) -> Vec<TableField>;
}
Expand description
A trait for mapping between Baserow field IDs and their human-readable names
This trait provides functionality to map between numeric field IDs used by Baserow and their corresponding human-readable names. This is useful when working with the API where field IDs are required, but you want to reference fields by their names in your code.
Required Methods§
Sourcefn map_fields(&mut self, fields: Vec<TableField>)
fn map_fields(&mut self, fields: Vec<TableField>)
Maps a collection of table fields, building the internal mapping structures
§Arguments
fields
- A vector of TableField structs containing field metadata
Sourcefn get_field_id(&self, name: &str) -> Option<u64>
fn get_field_id(&self, name: &str) -> Option<u64>
Sourcefn get_field_name(&self, id: u64) -> Option<String>
fn get_field_name(&self, id: u64) -> Option<String>
Sourcefn get_fields(&self) -> Vec<TableField>
fn get_fields(&self) -> Vec<TableField>
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.