Struct dao::bid_escrow::job::Job
source · pub struct Job { /* private fields */ }
Expand description
Serializable representation of a Job
.
Implementations§
source§impl Job
impl Job
sourcepub fn new(request: &PickBidRequest) -> Self
pub fn new(request: &PickBidRequest) -> Self
Conditionally creates a new instance of Job.
Runs validation:
Stops contract execution if any validation fails.
sourcepub fn reclaim(&mut self, request: ReclaimJobRequest) -> Job
pub fn reclaim(&mut self, request: ReclaimJobRequest) -> Job
Changes the status to Completed, creates a new job
with a new Worker
and BidId
.
sourcepub fn validate_cancel(
&self,
block_time: BlockTime,
caller: Address
) -> Result<(), Error>
pub fn validate_cancel( &self, block_time: BlockTime, caller: Address ) -> Result<(), Error>
Verifies if the job can be canceled at a given time.
§Errors
sourcepub fn submit_proof(&mut self, request: SubmitJobProofRequest)
pub fn submit_proof(&mut self, request: SubmitJobProofRequest)
sourcepub fn result(&self) -> Option<&DocumentHash>
pub fn result(&self) -> Option<&DocumentHash>
Gets the job’s result.
sourcepub fn job_offer_id(&self) -> JobOfferId
pub fn job_offer_id(&self) -> JobOfferId
Gets the job’s offer id.
sourcepub fn job_proof(&self) -> Option<&DocumentHash>
pub fn job_proof(&self) -> Option<&DocumentHash>
Gets confirmation the job has been done.
sourcepub fn finish_time(&self) -> BlockTime
pub fn finish_time(&self) -> BlockTime
Gets the job’s finish time.
sourcepub fn worker_type(&self) -> &WorkerType
pub fn worker_type(&self) -> &WorkerType
Gets the job’s worker type.
sourcepub fn is_unbound(&self) -> bool
pub fn is_unbound(&self) -> bool
If the worker’s vote should be unbound - basically is the reputation real
sourcepub fn external_worker_cspr_stake(&self) -> Balance
pub fn external_worker_cspr_stake(&self) -> Balance
Gets the job’s CSPR stake.
sourcepub fn set_voting_id(&mut self, voting_id: VotingId)
pub fn set_voting_id(&mut self, voting_id: VotingId)
Links job with Voting.
Trait Implementations§
source§impl BorshDeserialize for Job
impl BorshDeserialize for Job
source§fn deserialize(buf: &mut &[u8]) -> Result<Self>
fn deserialize(buf: &mut &[u8]) -> Result<Self>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
Auto Trait Implementations§
impl RefUnwindSafe for Job
impl Send for Job
impl Sync for Job
impl Unpin for Job
impl UnwindSafe for Job
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