pub struct SortLease { /* private fields */ }Expand description
An admitted sort: the chosen SortPlan, a private scratch directory,
and the global resource permits held for the sort’s lifetime.
Dropping the lease returns the file-descriptor permits and the
concurrency slot. Keep the lease alive until the value stream from
SortSession::finish is fully consumed — dropping it early returns
the fd budget while the merge may still be reading run files.
Implementations§
Source§impl SortLease
impl SortLease
Sourcepub fn scratch_dir(&self) -> &Path
pub fn scratch_dir(&self) -> &Path
The private scratch directory this sort may spill into.
Sourcepub fn into_session<K, V>(self, dedup: bool) -> SortSession<K, V>where
K: Ord + Clone + Serialize + DeserializeOwned + Send + 'static,
V: Serialize + DeserializeOwned + Send + 'static,
pub fn into_session<K, V>(self, dedup: bool) -> SortSession<K, V>where
K: Ord + Clone + Serialize + DeserializeOwned + Send + 'static,
V: Serialize + DeserializeOwned + Send + 'static,
Open the sort session bound to this lease, consuming the lease into the session so its fd permits live for as long as the sort’s output stream — there is no way to drop the lease early by accident.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SortLease
impl RefUnwindSafe for SortLease
impl Send for SortLease
impl Sync for SortLease
impl Unpin for SortLease
impl UnsafeUnpin for SortLease
impl UnwindSafe for SortLease
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