pub trait StaticDataFormatter {
type Output;
// Required methods
fn stdfmt_null() -> Self::Output;
fn stdfmt_bool(value: &bool) -> Self::Output;
fn stdfmt_string(value: &str) -> Self::Output;
fn stdfmt_i64(value: &i64) -> Self::Output;
fn stdfmt_f64(value: &f64) -> Self::Output;
fn stdfmt_ip_addr(value: &IpAddr) -> Self::Output;
fn stdfmt_datetime(value: &NaiveDateTime) -> Self::Output;
fn stdfmt_object(value: &ObjectValue) -> Self::Output;
fn stdfmt_array(value: &[FieldStorage]) -> Self::Output;
fn stdfmt_field(field: &FieldStorage) -> Self::Output;
fn stdfmt_record(record: &DataRecord) -> Self::Output;
// Provided method
fn stdfmt_value(value: &Value) -> Self::Output { ... }
}Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
Expand description
旧的 StaticDataFormatter trait
已弃用: 请使用 ValueFormatter 替代(使用实例而不是静态方法)。
这个 trait 将在下一个主要版本中移除。
Required Associated Types§
type Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
Required Methods§
fn stdfmt_null() -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_bool(value: &bool) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_string(value: &str) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_i64(value: &i64) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_f64(value: &f64) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_ip_addr(value: &IpAddr) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_datetime(value: &NaiveDateTime) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_object(value: &ObjectValue) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_array(value: &[FieldStorage]) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_field(field: &FieldStorage) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
fn stdfmt_record(record: &DataRecord) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
Provided Methods§
fn stdfmt_value(value: &Value) -> Self::Output
Use ValueFormatter instead with instance methods. This trait will be removed in the next major version.
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.