Skip to main content

Module any

Module any 

Source
Expand description

Type-erased table wrapper with downcasting support

AnyTable provides a way to store tables of different types uniformly while preserving the ability to recover the concrete type through downcasting.

Tables whose value/id types differ from ciborium::Value/String can still be wrapped via AnyTable::from_table as long as the value type implements Into<CborValue> + From<CborValue> and the id type implements Display + From<String>.

Each backend brings its own native value type (AnySurrealType, AnyMongoType, AnyPostgresType, etc.); CBOR is just the carrier across the type-erased boundary, chosen because it preserves type fidelity that JSON loses (integer vs float, binary blobs, NaN/Infinity, precise decimals).

Structs§

AnyTable
Type-erased table that can be downcast to concrete Table<T, E> Works with AnyRecord (which uses ciborium::Value)

Type Aliases§

AnyRecord