Skip to content

Commit

Permalink
Update to upcoming Rustler v0.34
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor committed Jul 9, 2024
1 parent f2f57e1 commit 72b18e5
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 481 deletions.
27 changes: 14 additions & 13 deletions native/explorer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion native/explorer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ chrono = "0.4"
chrono-tz = "0.9"
rand = { version = "0.8", features = ["alloc"] }
rand_pcg = "0.3"
rustler = { version = "0.32", default-features = false, features = ["derive"] }
rustler = { version = "0.34.0" }
thiserror = "1"
smartstring = "1"
either = "1"
Expand Down
17 changes: 16 additions & 1 deletion native/explorer/src/datatypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use chrono::prelude::*;
#[cfg(feature = "cloud")]
use polars::prelude::cloud::CloudOptions;
use polars::prelude::*;
use rustler::{Atom, NifStruct, NifTaggedEnum, ResourceArc};
use rustler::{Atom, NifStruct, NifTaggedEnum, Resource, ResourceArc};
use std::fmt;
use std::ops::Deref;

Expand All @@ -22,10 +22,25 @@ use chrono_tz::{OffsetComponents, OffsetName, Tz};
pub use ex_dtypes::*;

pub struct ExDataFrameRef(pub DataFrame);

#[rustler::resource_impl]
impl Resource for ExDataFrameRef {}

pub struct ExExprRef(pub Expr);

#[rustler::resource_impl]
impl Resource for ExExprRef {}

pub struct ExLazyFrameRef(pub LazyFrame);

#[rustler::resource_impl]
impl Resource for ExLazyFrameRef {}

pub struct ExSeriesRef(pub Series);

#[rustler::resource_impl]
impl Resource for ExSeriesRef {}

// The structs that start with "Ex" are related to the modules in Elixir.
// Some of them are just wrappers around Polars data structs.
// For example, a "ExDataFrame" is a wrapper around Polars' "DataFrame".
Expand Down
Loading

0 comments on commit 72b18e5

Please sign in to comment.