pub struct SorterHandle { /* private fields */ }Expand description
A handle to the process Sorter. Clone freely; all clones address the one governor actor.
Implementations§
Source§impl SorterHandle
impl SorterHandle
Sourcepub fn spawn(
config: SorterConfig,
fd_budget: u32,
pressure: Arc<dyn MemoryPressure>,
scratch_root: PathBuf,
) -> Self
pub fn spawn( config: SorterConfig, fd_budget: u32, pressure: Arc<dyn MemoryPressure>, scratch_root: PathBuf, ) -> Self
Spawn the governor and return a handle to it. fd_budget is the
number of usable file descriptors the Sorter may ration (the process
soft limit minus a safety margin); sorts spill under unique
directories beneath scratch_root.
Sourcepub async fn submit(&self, spec: SortSpec) -> Result<SortLease, SorterError>
pub async fn submit(&self, spec: SortSpec) -> Result<SortLease, SorterError>
Admit a sort: the governor plans it, reserves its resources, and returns a lease. The returned lease must be held until the sort’s value stream is fully consumed.
§Errors
Returns SorterError::Gone if the governor is no longer running.
Sourcepub async fn stats(&self) -> Result<SorterStats, SorterError>
pub async fn stats(&self) -> Result<SorterStats, SorterError>
Read the governor’s current counters.
§Errors
Returns SorterError::Gone if the governor is no longer running.
Trait Implementations§
Source§impl Clone for SorterHandle
impl Clone for SorterHandle
Source§fn clone(&self) -> SorterHandle
fn clone(&self) -> SorterHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SorterHandle
impl RefUnwindSafe for SorterHandle
impl Send for SorterHandle
impl Sync for SorterHandle
impl Unpin for SorterHandle
impl UnsafeUnpin for SorterHandle
impl UnwindSafe for SorterHandle
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