use std::cmp;
use crate::depot::heap::{self, hole};
pub unsafe trait Source: Sized {
type Value;
fn len(&self) -> u32;
fn is_empty(&self) -> bool {
self.len() == 0
}
unsafe fn len_mut(&mut self) -> &mut u32;
fn compare(entry: hole::At<&Self, &Self::Value>) -> cmp::Ordering;
fn direction(entry: hole::At<&Self, &Self::Value>) -> cmp::Ordering {
Self::compare(entry)
}
fn compare_at(left: hole::At<&Self>, right: hole::At<&Self>) -> cmp::Ordering;
fn read<const REMOVE: bool>(entry: hole::At<&mut Self>) -> Self::Value;
unsafe fn entry<V>(self, position: usize, value: V) -> heap::Entry<Self, V> {
unsafe { heap::Entry::new(self, position, value) }
}
unsafe fn vacancy(self, value: Self::Value) -> heap::Vacancy<Self, Self::Value> {
unsafe { heap::Vacancy::new(self, value) }
}
unsafe fn update(entry: heap::Entry<Self, Self::Value>) {
heap::raw::Hole::update(entry);
}
fn shift(step: hole::Step<'_, Self>);
fn write<const PLACE: bool>(finish: hole::Finish<Self>) -> Self;
}