pub(crate) enum Promotion {
Direct,
IntToLong,
IntToFloat,
IntToDouble,
LongToFloat,
LongToDouble,
FloatToDouble,
StringToBytes,
BytesToString,
}展开描述
定义在模式解析过程中应用的提升类型。
模式解析可能需要将写入器的数据类型提升为读取器的数据类型。例如,int 可以提升为 long、float 或 double。
变体§
直接
直接读取,不进行数据类型提升。
整型转长整型
将 int 提升为 long。
整型转浮点
将 int 提升为 float。
整型转双精度
将 int 提升为 double。
长整型转浮点
将 long 提升为 float。
长整型转双精度
将 long 提升为 double。
浮点转双精度
将 float 提升为 double。
字符串转字节
将 string 提升为 bytes。
字节转字符串
将 bytes 提升为 string。
Trait 实现§
为 Promotion 实现 Copy
为 Promotion 实现 Eq
为 Promotion 实现 StructuralPartialEq
自动 Trait 实现§
为 Promotion 实现 Freeze
为 Promotion 实现 RefUnwindSafe
为 Promotion 实现 Send
为 Promotion 实现 Sync
为 Promotion 实现 Unpin
为 Promotion 实现 UnwindSafe
通用实现§
源§impl<T> CloneToUninit for Twhere T: Clone,
impl<T> CloneToUninit for Twhere T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
将 self 与
key 进行比较,如果它们相等则返回 true。