Expand description
AnyValue is concept of type-erased object, that can be moved around without type knowledge.
With default trait implementation, all “consume” operations boils down to move_into. By redefining move_into and Drop1 behavior - you can have some additional logic on AnyValue consumption. (Consumption - is any operation that “move out” data from AnyValue)
AnyValueSizeless -> AnyValueTypeless -> AnyValue
§Usage
Some AnyVec operations will accept and return AnyValue. This allows to move data between AnyVecs in fast, safe, type erased way.
AnyValue could have blanket implementation for Drop as well, but that is unstable Rust now. ↩
Modules§
- Prelude for traits.
Structs§
- AnyValue byte ptr wrapper, that know it’s type.
- AnyValueSizeless non-owning byte ptr wrapper, that knows nothing about it’s type.
- AnyValueTypeless byte ptr wrapper, that know it’s type size.
- Helper struct to convert concrete type to
AnyValueMut
. - Makes
AnyValueCloneable
actuallyClone
able. Clone underlying value on consumption. - Marker for unknown type.
Traits§
- Type erased value interface.
LazyClone
friendlyAnyValueSizeless
.- Mutable AnyValue.
- AnyValue that doesn’t know its size or type, and can provide only object ptr.
- Mutable AnyValueSizeless.
- AnyValue that doesn’t know it’s type, but know it’s size.
- Mutable AnyValueTypeless.