polars_python/functions/
string_cache.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use polars_core::StringCacheHolder;
use pyo3::prelude::*;

#[pyfunction]
pub fn enable_string_cache() {
    polars_core::enable_string_cache()
}

#[pyfunction]
pub fn disable_string_cache() {
    polars_core::disable_string_cache()
}

#[pyfunction]
pub fn using_string_cache() -> bool {
    polars_core::using_string_cache()
}

#[pyclass]
pub struct PyStringCacheHolder {
    _inner: StringCacheHolder,
}

#[pymethods]
impl PyStringCacheHolder {
    #[new]
    fn new() -> Self {
        Self {
            _inner: StringCacheHolder::hold(),
        }
    }
}