pub struct ScheduleResponse { /* private fields */ }Expand description
What CompactionService::schedule hands back: a status, and a job id for
wait to block on.
§Ownership
Returning one of these transfers it to RocksDB, which moves the value out
and runs delete on the wrapper (c.cc:1302 and c.cc:1303). The transfer
happens inside this crate’s callback trampoline, which suppresses the
Drop below. Anything a
schedule implementation builds and then
discards instead is destroyed normally by that Drop, so neither path
leaks and neither double frees.
Implementations§
Source§impl ScheduleResponse
impl ScheduleResponse
Sourcepub fn scheduled(
scheduled_job_id: impl CStrLike,
status: CompactionServiceJobStatus,
) -> Result<Self, Error>
pub fn scheduled( scheduled_job_id: impl CStrLike, status: CompactionServiceJobStatus, ) -> Result<Self, Error>
Reports a job that reached the worker fleet, under the id
wait will be called with.
The id is read as a NUL terminated string on the C++ side and handed
back to wait and
on_installation the same way, so
it round trips unchanged.
A status of Success is the only
one that makes RocksDB go on to wait. The others are better expressed
with from_status, which leaves the id empty.
§Errors
Returns an error if scheduled_job_id contains an interior NUL byte.
Sourcepub fn from_status(status: CompactionServiceJobStatus) -> Self
pub fn from_status(status: CompactionServiceJobStatus) -> Self
Reports a status with no job id, for a job that never got scheduled.
Sourcepub fn status(&self) -> Option<CompactionServiceJobStatus>
pub fn status(&self) -> Option<CompactionServiceJobStatus>
The status this response carries, or None for a value this crate does
not name.
Sourcepub fn scheduled_job_id(&self) -> &[u8] ⓘ
pub fn scheduled_job_id(&self) -> &[u8] ⓘ
The job id this response carries, empty when it came from
from_status.
Borrowed from the std::string inside the response (c.cc:1248), so
nothing is copied.