serde_hashkey

Trait FloatRepr

Source
pub trait FloatRepr<T>:
    Sealed<T>
    + Copy
    + Sized
    + Debug
    + Serialize
    + Eq
    + Ord
    + Hash {
    // Required methods
    fn serialize(value: T) -> Result<Self, Error>;
    fn visit<'de, V>(&self, visitor: V) -> Result<V::Value, Error>
       where V: Visitor<'de>;
}
Expand description

Trait implemented by floating point types which can be used in a FloatPolicy. This is implemented by the type representing a float, typically a wrapper, and defines the protocol necessary to incorporate the floating point type T into the Key protocol.

Required Methods§

Source

fn serialize(value: T) -> Result<Self, Error>

Serialize impl for a floating point value.

Source

fn visit<'de, V>(&self, visitor: V) -> Result<V::Value, Error>
where V: Visitor<'de>,

Visit the current value.

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.

Implementors§