pub unsafe trait ScalarValue:
Copy
+ Send
+ Sync
+ 'static {
// Required methods
fn type_id() -> TypeId;
unsafe fn read(reader: &VectorReader, row: usize) -> Self;
}Expand description
A Rust type that maps 1:1 onto a DuckDB scalar column type.
Implemented for bool, every signed and unsigned integer width DuckDB has
(i8..i128, u8..u128), and f32 / f64. These are the types the
closure-based constructors accept as arguments.
§Safety
read performs an unchecked typed read of a vector’s data
buffer. An implementation must return the type that
type_id names, or reads will silently reinterpret memory.
This is why the trait is unsafe to implement; using it is entirely safe.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".