Skip to content

Commit da63981

Browse files
authored
chore(native): Expose API as library (#8392)
1 parent bfd560c commit da63981

File tree

5 files changed

+503
-495
lines changed

5 files changed

+503
-495
lines changed

packages/cubejs-backend-native/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage = "https://cube.dev"
1010
exclude = ["index.node"]
1111

1212
[lib]
13-
crate-type = ["cdylib"]
13+
crate-type = ["cdylib", "lib"]
1414

1515
[dependencies]
1616
cubesql = { path = "../../rust/cubesql/cubesql" }

packages/cubejs-backend-native/build.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/cubejs-backend-native/src/cross/clrepr.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ use std::sync::Arc;
1818
#[derive(Clone)]
1919
pub struct CLReprObject(pub(crate) HashMap<String, CLRepr>);
2020

21+
impl Default for CLReprObject {
22+
fn default() -> Self {
23+
Self::new()
24+
}
25+
}
26+
2127
impl CLReprObject {
2228
pub fn new() -> Self {
2329
Self(HashMap::new())
@@ -31,10 +37,6 @@ impl CLReprObject {
3137
self.0.insert(key, value)
3238
}
3339

34-
pub fn into_iter(self) -> IntoIter<String, CLRepr> {
35-
self.0.into_iter()
36-
}
37-
3840
pub fn iter(&self) -> Iter<String, CLRepr> {
3941
self.0.iter()
4042
}
@@ -44,6 +46,15 @@ impl CLReprObject {
4446
}
4547
}
4648

49+
impl IntoIterator for CLReprObject {
50+
type Item = (String, CLRepr);
51+
type IntoIter = IntoIter<String, CLRepr>;
52+
53+
fn into_iter(self) -> Self::IntoIter {
54+
self.0.into_iter()
55+
}
56+
}
57+
4758
impl std::fmt::Debug for CLReprObject {
4859
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4960
std::fmt::Debug::fmt(&self.0, f)

0 commit comments

Comments
 (0)