DataFormat

Trait DataFormat 

Source
pub trait DataFormat {
    type Output;

    // Required methods
    fn format_null(&self) -> Self::Output;
    fn format_bool(&self, value: &bool) -> Self::Output;
    fn format_string(&self, value: &str) -> Self::Output;
    fn format_i64(&self, value: &i64) -> Self::Output;
    fn format_f64(&self, value: &f64) -> Self::Output;
    fn format_ip(&self, value: &IpAddr) -> Self::Output;
    fn format_datetime(&self, value: &NaiveDateTime) -> Self::Output;
    fn format_object(&self, value: &ObjectValue) -> Self::Output;
    fn format_array(&self, value: &[DataField]) -> Self::Output;
    fn format_field(&self, field: &DataField) -> Self::Output;
    fn format_record(&self, record: &DataRecord) -> Self::Output;

    // Provided method
    fn fmt_value(&self, value: &Value) -> Self::Output { ... }
}

Required Associated Types§

Required Methods§

Source

fn format_null(&self) -> Self::Output

Source

fn format_bool(&self, value: &bool) -> Self::Output

Source

fn format_string(&self, value: &str) -> Self::Output

Source

fn format_i64(&self, value: &i64) -> Self::Output

Source

fn format_f64(&self, value: &f64) -> Self::Output

Source

fn format_ip(&self, value: &IpAddr) -> Self::Output

Source

fn format_datetime(&self, value: &NaiveDateTime) -> Self::Output

Source

fn format_object(&self, value: &ObjectValue) -> Self::Output

Source

fn format_array(&self, value: &[DataField]) -> Self::Output

Source

fn format_field(&self, field: &DataField) -> Self::Output

Source

fn format_record(&self, record: &DataRecord) -> Self::Output

Provided Methods§

Source

fn fmt_value(&self, value: &Value) -> Self::Output

Implementors§