Skip to main content

ScheduleResponse

Struct ScheduleResponse 

Source
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

Source

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.

Source

pub fn from_status(status: CompactionServiceJobStatus) -> Self

Reports a status with no job id, for a job that never got scheduled.

Source

pub fn status(&self) -> Option<CompactionServiceJobStatus>

The status this response carries, or None for a value this crate does not name.

Source

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.

Trait Implementations§

Source§

impl Drop for ScheduleResponse

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for ScheduleResponse

Source§

impl Sync for ScheduleResponse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.