pub struct StorageJobs { /* private fields */ }Expand description
Occupancy for submitted storage work. Charges stay on the original transfer.
Implementations§
Source§impl StorageJobs
impl StorageJobs
Sourcepub fn may_publish_verified(
&self,
runtime: &TransferRuntime<'_>,
ticket: &TransferTicket,
job: &StorageJobTicket,
) -> Result<bool, QdnfError>
pub fn may_publish_verified( &self, runtime: &TransferRuntime<'_>, ticket: &TransferTicket, job: &StorageJobTicket, ) -> Result<bool, QdnfError>
True only while the original transfer is still InFlight and the job was
not cancelled or failed. Call after I/O, before Self::complete_io.
Sourcepub fn observe_worker_failure(
&mut self,
runtime: &mut TransferRuntime<'_>,
ticket: &TransferTicket,
job: &StorageJobTicket,
) -> Result<(), QdnfError>
pub fn observe_worker_failure( &mut self, runtime: &mut TransferRuntime<'_>, ticket: &TransferTicket, job: &StorageJobTicket, ) -> Result<(), QdnfError>
Worker error/panic: keep the original charge and buffer occupancy.
The slot is not vacant; Self::complete_io is still required.
Sourcepub fn complete_io(
&mut self,
runtime: &mut TransferRuntime<'_>,
ticket: &mut TransferTicket,
job: &mut StorageJobTicket,
now: u64,
) -> Result<FinishOutcome, QdnfError>
pub fn complete_io( &mut self, runtime: &mut TransferRuntime<'_>, ticket: &mut TransferTicket, job: &mut StorageJobTicket, now: u64, ) -> Result<FinishOutcome, QdnfError>
Exactly-once parent complete plus job retirement. A second call refuses without touching the original ledger again.
Sourcepub fn take_completed(
&mut self,
ticket: &TransferTicket,
job: &mut StorageJobTicket,
) -> Result<(), QdnfError>
pub fn take_completed( &mut self, ticket: &TransferTicket, job: &mut StorageJobTicket, ) -> Result<(), QdnfError>
Job-table half after a parent complete_io performed through another
access path (for example a short RuntimeParents scope). Does not refund.
Source§impl StorageJobs
impl StorageJobs
pub fn for_owner(owner: usize) -> Self
pub fn for_runtime(runtime: &TransferRuntime<'_>) -> Self
pub const fn live_jobs(&self) -> usize
pub const fn owner(&self) -> usize
pub fn reserved_bytes(&self) -> u64
pub fn buffer_held(&self, job: &StorageJobTicket) -> Result<bool, QdnfError>
Sourcepub fn submit(
&mut self,
runtime: &mut TransferRuntime<'_>,
ticket: &TransferTicket,
payload: &[u8],
proof: &[u8],
scratch: &mut [u8],
now: u64,
policy: Generation,
) -> Result<StorageJobTicket, QdnfError>
pub fn submit( &mut self, runtime: &mut TransferRuntime<'_>, ticket: &TransferTicket, payload: &[u8], proof: &[u8], scratch: &mut [u8], now: u64, policy: Generation, ) -> Result<StorageJobTicket, QdnfError>
Recheck the live stage, retain already-charged buffer occupancy, drop the stage before returning. No second ReservationLedger is created.
Sourcepub fn submit_stage(
&mut self,
ticket: &TransferTicket,
stage: StorageStage<'_, '_>,
now: u64,
policy: Generation,
) -> Result<StorageJobTicket, QdnfError>
pub fn submit_stage( &mut self, ticket: &TransferTicket, stage: StorageStage<'_, '_>, now: u64, policy: Generation, ) -> Result<StorageJobTicket, QdnfError>
Same occupancy rules when the caller already holds a short stage. The stage value is dropped before this returns.
Sourcepub fn cancel(
&mut self,
runtime: &mut TransferRuntime<'_>,
ticket: &TransferTicket,
job: &StorageJobTicket,
) -> Result<(), QdnfError>
pub fn cancel( &mut self, runtime: &mut TransferRuntime<'_>, ticket: &TransferTicket, job: &StorageJobTicket, ) -> Result<(), QdnfError>
Marks Cancelling on the job and the original transfer. The worker still
owns the already-charged buffers until StorageJobs::complete_io.
Auto Trait Implementations§
impl Freeze for StorageJobs
impl RefUnwindSafe for StorageJobs
impl Send for StorageJobs
impl Sync for StorageJobs
impl Unpin for StorageJobs
impl UnsafeUnpin for StorageJobs
impl UnwindSafe for StorageJobs
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more