pub trait FreeList: Sync + Downcast {
Show 34 methods
// Required methods
fn head(&self) -> i32;
fn heads(&self) -> i32;
fn get_entry(&self, index: i32) -> i32;
fn set_entry(&mut self, index: i32, value: i32);
// Provided methods
fn alloc(&mut self, size: i32) -> i32 { ... }
fn alloc_from_unit(&mut self, size: i32, unit: i32) -> i32 { ... }
fn free(&mut self, unit: i32, return_coalesced_size: bool) -> i32 { ... }
fn size(&self, unit: i32) -> i32 { ... }
fn initialize_heap(&mut self, units: i32, grain: i32) { ... }
fn add_to_free(&mut self, unit: i32) { ... }
fn get_right(&self, unit: i32) -> i32 { ... }
fn set_sentinel(&mut self, unit: i32) { ... }
fn get_size(&self, unit: i32) -> i32 { ... }
fn set_size(&mut self, unit: i32, size: i32) { ... }
fn get_free(&self, unit: i32) -> bool { ... }
fn set_free(&mut self, unit: i32, is_free: bool) { ... }
fn get_next(&self, unit: i32) -> i32 { ... }
fn set_next(&mut self, unit: i32, next: i32) { ... }
fn get_prev(&self, unit: i32) -> i32 { ... }
fn set_prev(&mut self, unit: i32, prev: i32) { ... }
fn get_left(&self, unit: i32) -> i32 { ... }
fn is_coalescable(&self, unit: i32) -> bool { ... }
fn clear_uncoalescable(&mut self, unit: i32) { ... }
fn set_uncoalescable(&mut self, unit: i32) { ... }
fn is_multi(&self, i: i32) -> bool { ... }
fn is_free(&self, i: i32) -> bool { ... }
fn get_lo_entry(&self, unit: i32) -> i32 { ... }
fn get_hi_entry(&self, unit: i32) -> i32 { ... }
fn set_lo_entry(&mut self, unit: i32, value: i32) { ... }
fn set_hi_entry(&mut self, unit: i32, value: i32) { ... }
fn __alloc(&mut self, size: i32, unit: i32, unit_size: i32) -> i32 { ... }
fn __split(&mut self, unit: i32, size: i32) { ... }
fn __coalesce(&mut self, start: i32, end: i32) { ... }
fn __remove_from_free(&mut self, unit: i32) { ... }
}
Required Methods§
fn head(&self) -> i32
fn heads(&self) -> i32
fn get_entry(&self, index: i32) -> i32
fn set_entry(&mut self, index: i32, value: i32)
Provided Methods§
fn alloc(&mut self, size: i32) -> i32
fn alloc_from_unit(&mut self, size: i32, unit: i32) -> i32
sourcefn free(&mut self, unit: i32, return_coalesced_size: bool) -> i32
fn free(&mut self, unit: i32, return_coalesced_size: bool) -> i32
Free a previously allocated contiguous lump of units
fn size(&self, unit: i32) -> i32
fn initialize_heap(&mut self, units: i32, grain: i32)
fn add_to_free(&mut self, unit: i32)
fn get_right(&self, unit: i32) -> i32
fn set_sentinel(&mut self, unit: i32)
fn get_size(&self, unit: i32) -> i32
fn set_size(&mut self, unit: i32, size: i32)
fn get_free(&self, unit: i32) -> bool
fn set_free(&mut self, unit: i32, is_free: bool)
fn get_next(&self, unit: i32) -> i32
fn set_next(&mut self, unit: i32, next: i32)
fn get_prev(&self, unit: i32) -> i32
fn set_prev(&mut self, unit: i32, prev: i32)
fn get_left(&self, unit: i32) -> i32
fn is_coalescable(&self, unit: i32) -> bool
fn clear_uncoalescable(&mut self, unit: i32)
fn set_uncoalescable(&mut self, unit: i32)
fn is_multi(&self, i: i32) -> bool
fn is_free(&self, i: i32) -> bool
fn get_lo_entry(&self, unit: i32) -> i32
fn get_hi_entry(&self, unit: i32) -> i32
fn set_lo_entry(&mut self, unit: i32, value: i32)
fn set_hi_entry(&mut self, unit: i32, value: i32)
fn __alloc(&mut self, size: i32, unit: i32, unit_size: i32) -> i32
fn __split(&mut self, unit: i32, size: i32)
fn __coalesce(&mut self, start: i32, end: i32)
fn __remove_from_free(&mut self, unit: i32)
Implementations§
source§impl dyn FreeList
impl dyn FreeList
sourcepub fn is<__T: FreeList>(&self) -> bool
pub fn is<__T: FreeList>(&self) -> bool
Returns true if the trait object wraps an object of type __T
.
sourcepub fn downcast<__T: FreeList>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>
pub fn downcast<__T: FreeList>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>
Returns a boxed object from a boxed trait object if the underlying object is of type
__T
. Returns the original boxed trait if it isn’t.
sourcepub fn downcast_rc<__T: FreeList>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>
pub fn downcast_rc<__T: FreeList>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>
Returns an Rc
-ed object from an Rc
-ed trait object if the underlying object is of
type __T
. Returns the original Rc
-ed trait if it isn’t.
sourcepub fn downcast_ref<__T: FreeList>(&self) -> Option<&__T>
pub fn downcast_ref<__T: FreeList>(&self) -> Option<&__T>
Returns a reference to the object within the trait object if it is of type __T
, or
None
if it isn’t.
sourcepub fn downcast_mut<__T: FreeList>(&mut self) -> Option<&mut __T>
pub fn downcast_mut<__T: FreeList>(&mut self) -> Option<&mut __T>
Returns a mutable reference to the object within the trait object if it is of type
__T
, or None
if it isn’t.