pub struct NameMapper { /* private fields */ }Expand description
Maps table and column names between the client and the server
(NameMapper).
Implementations§
Source§impl NameMapper
impl NameMapper
Sourcepub fn client_to_server(schema: &Schema) -> Self
pub fn client_to_server(schema: &Schema) -> Self
clientToServer.
Sourcepub fn server_to_client(schema: &Schema) -> Self
pub fn server_to_client(schema: &Schema) -> Self
serverToClient.
pub fn table_name(&self, src: &str) -> Result<String, NameMappingError>
pub fn column_name( &self, table: &str, src: &str, ) -> Result<String, NameMappingError>
Sourcepub fn json_column_name(
&self,
table: &str,
src: &str,
) -> Result<String, NameMappingError>
pub fn json_column_name( &self, table: &str, src: &str, ) -> Result<String, NameMappingError>
jsonColumnName: the column a JSON path reads, which must be a json
column. An unknown column fails the same way as a known one that
isn’t json.
Sourcepub fn table_name_if_known(&self, src: &str) -> Option<String>
pub fn table_name_if_known(&self, src: &str) -> Option<String>
The mapped name of table src, or None for a table the schema
doesn’t have.
Sourcepub fn columns(
&self,
table: &str,
columns: &[String],
) -> Result<Vec<String>, NameMappingError>
pub fn columns( &self, table: &str, columns: &[String], ) -> Result<Vec<String>, NameMappingError>
Renames the known columns of table; others keep their names.
Sourcepub fn row(&self, table: &str, row: &Object) -> Result<Object, NameMappingError>
pub fn row(&self, table: &str, row: &Object) -> Result<Object, NameMappingError>
Renames the known columns of row; others keep their names.
Sourcepub fn map(&self, ast: &Ast) -> Result<Ast, NameMappingError>
pub fn map(&self, ast: &Ast) -> Result<Ast, NameMappingError>
mapAST: the AST with its table and column names mapped.
Sourcepub fn map_condition(
&self,
condition: &Condition,
table: &str,
) -> Result<Condition, NameMappingError>
pub fn map_condition( &self, condition: &Condition, table: &str, ) -> Result<Condition, NameMappingError>
mapCondition. Only the left side of a comparison names a column.
Auto Trait Implementations§
impl Forget for NameMapper
impl Freeze for NameMapper
impl Move for NameMapper
impl RefUnwindSafe for NameMapper
impl Send for NameMapper
impl Sync for NameMapper
impl Unpin for NameMapper
impl UnsafeUnpin for NameMapper
impl UnwindSafe for NameMapper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more