Sha256: 7df0f5291db6a6eab48578b7030c907192bde70da28d2d3f088a67ac6070ac78
Contents?: true
Size: 1006 Bytes
Versions: 1
Compression:
Stored size: 1006 Bytes
Contents
use std::any::Any; use std::sync::Arc; use magnus::IntoValue; use polars_core::chunked_array::object::builder::ObjectChunkedBuilder; use polars_core::chunked_array::object::registry; use polars_core::chunked_array::object::registry::AnonymousObjectBuilder; use polars_core::prelude::AnyValue; use crate::prelude::ObjectValue; use crate::Wrap; pub(crate) const OBJECT_NAME: &str = "object"; pub(crate) fn register_object_builder() { if !registry::is_object_builder_registered() { let object_builder = Box::new(|name: &str, capacity: usize| { Box::new(ObjectChunkedBuilder::<ObjectValue>::new(name, capacity)) as Box<dyn AnonymousObjectBuilder> }); let object_converter = Arc::new(|av: AnyValue| { let object = ObjectValue { inner: Wrap(av).into_value().into(), }; Box::new(object) as Box<dyn Any> }); registry::register_object_builder(object_builder, object_converter) } }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
polars-df-0.7.0 | ext/polars/src/object.rs |