pub struct PolarsAllocator(/* private fields */);
Expand description
A memory allocator that relays allocations to the allocator used by Polars.
You can use it as the global memory allocator:
use pyo3_polars::PolarsAllocator;
#[global_allocator]
static ALLOC: PolarsAllocator = PolarsAllocator::new();
If the allocator capsule (polars.polars._allocator
) is not available,
this allocator fallbacks to std::alloc::System
.
Implementations§
Trait Implementations§
Source§impl Default for PolarsAllocator
impl Default for PolarsAllocator
Source§impl GlobalAlloc for PolarsAllocator
impl GlobalAlloc for PolarsAllocator
Source§unsafe fn alloc(&self, layout: Layout) -> *mut u8
unsafe fn alloc(&self, layout: Layout) -> *mut u8
Allocates memory as described by the given
layout
. Read moreAuto Trait Implementations§
impl !Freeze for PolarsAllocator
impl !RefUnwindSafe for PolarsAllocator
impl Send for PolarsAllocator
impl Sync for PolarsAllocator
impl Unpin for PolarsAllocator
impl UnwindSafe for PolarsAllocator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more