pub struct PythonHeap { /* private fields */ }Expand description
Python managed heap composed from the shared arena and optional collector.
Implementations§
Source§impl PythonHeap
impl PythonHeap
Sourcepub fn standard(
cap: usize,
limits: CollectionLimits,
) -> Result<Self, ArenaError>
pub fn standard( cap: usize, limits: CollectionLimits, ) -> Result<Self, ArenaError>
Create the standard tracing heap.
Sourcepub fn retaining(cap: usize) -> Result<Self, ArenaError>
pub fn retaining(cap: usize) -> Result<Self, ArenaError>
Create the explicit no-collector heap whose cycle leak is reported by cycle_leak_gap.
Sourcepub fn allocate(
&mut self,
value: PythonManagedObject,
) -> Result<ManagedHandle, ArenaError>
pub fn allocate( &mut self, value: PythonManagedObject, ) -> Result<ManagedHandle, ArenaError>
Allocate a cyclic-capable value only in the managed arena.
Sourcepub fn connect(
&mut self,
from: ManagedHandle,
to: ManagedHandle,
) -> Result<(), ArenaError>
pub fn connect( &mut self, from: ManagedHandle, to: ManagedHandle, ) -> Result<(), ArenaError>
Add a strong language edge between two managed values.
Sourcepub const fn policy(&self) -> PythonHeapPolicy
pub const fn policy(&self) -> PythonHeapPolicy
Return selected policy.
Sourcepub const fn cycle_leak_gap(&self) -> Option<&'static str>
pub const fn cycle_leak_gap(&self) -> Option<&'static str>
Return the explicit retention gap, if selected.
Sourcepub fn collect(&mut self) -> Result<Option<CollectionReceipt>, CollectionError>
pub fn collect(&mut self) -> Result<Option<CollectionReceipt>, CollectionError>
Run a safepoint. Retention performs no implicit collection.
Auto Trait Implementations§
impl Freeze for PythonHeap
impl RefUnwindSafe for PythonHeap
impl Send for PythonHeap
impl Sync for PythonHeap
impl Unpin for PythonHeap
impl UnsafeUnpin for PythonHeap
impl UnwindSafe for PythonHeap
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