Skip to main content

as_num

Function as_num 

Source
fn as_num<T>(variant: &Variant<'_, '_>) -> Option<T>
Expand description

Converts a boolean or numeric variant(integers, floating-point, and decimals) to the specified numeric type T.

Uses Arrow’s casting logic to perform the conversion. Returns Some(T) if the conversion succeeds, None if the variant can’t be casted to type T.