Trait TableChecker

Source
pub trait TableChecker:
    Sync
    + Send
    + 'static {
    // Required method
    fn check(&self, table_name: &str) -> Result<(), Status>;

    // Provided method
    fn to_checked(&self, table_name: String) -> Result<String, Status> { ... }
}
Expand description

Checks the table name to prevent unexpected sql(e.g, SQL injection).

Required Methods§

Source

fn check(&self, table_name: &str) -> Result<(), Status>

Checks the name of the table.

Provided Methods§

Source

fn to_checked(&self, table_name: String) -> Result<String, Status>

Converts the table name to the checked name if it is valid.

Implementors§

Source§

impl<F> TableChecker for CheckFn<F>
where F: Fn(&str) -> Result<(), Status> + Send + Sync + 'static,