pub trait EncodeColumn<DB> {
// Required methods
fn column_type(&self) -> &str;
fn encode_value<'a>(&self, value: Option<&'a JsonValue>) -> Cow<'a, str>;
fn format_value<'a>(&self, value: &'a str) -> Cow<'a, str>;
fn format_filter(&self, key: &str, value: &JsonValue) -> String;
}
Expand description
Encodes the column to be sent to the database.
Required Methods§
Sourcefn column_type(&self) -> &str
fn column_type(&self) -> &str
Returns the corresponding column type in the database.
Sourcefn encode_value<'a>(&self, value: Option<&'a JsonValue>) -> Cow<'a, str>
fn encode_value<'a>(&self, value: Option<&'a JsonValue>) -> Cow<'a, str>
Encodes a json value as a column value represented by a str.
Sourcefn format_value<'a>(&self, value: &'a str) -> Cow<'a, str>
fn format_value<'a>(&self, value: &'a str) -> Cow<'a, str>
Formats a string value for the column.
Sourcefn format_filter(&self, key: &str, value: &JsonValue) -> String
fn format_filter(&self, key: &str, value: &JsonValue) -> String
Formats a column filter.