Struct dao::bid_escrow::job_offer::JobOffer
source · pub struct JobOffer {
pub job_offer_id: JobOfferId,
pub job_poster: Address,
pub max_budget: Balance,
pub expected_timeframe: BlockTime,
pub dos_fee: Balance,
pub status: JobOfferStatus,
pub start_time: BlockTime,
pub configuration: Configuration,
}
Expand description
Writeable/readable representation of a Job Offer
.
Fields§
§job_offer_id: JobOfferId
Offer id.
job_poster: Address
The offer creator.
max_budget: Balance
Max amount the Job Poster can pay for the Job.
expected_timeframe: BlockTime
The time the Job should be completed.
dos_fee: Balance
CSPR amount attached to the offer.
status: JobOfferStatus
The current job offer status.
start_time: BlockTime
The time since the offer is available for Bidders.
configuration: Configuration
Job configuration.
Implementations§
source§impl JobOffer
impl JobOffer
sourcepub fn new(request: PostJobOfferRequest) -> JobOffer
pub fn new(request: PostJobOfferRequest) -> JobOffer
Conditionally creates a new instance of JobOffer.
Runs validation:
IsUserKyced
IsDosFeeEnough
Stops contract execution if any validation fails.
sourcepub fn in_progress(&mut self, request: &PickBidRequest)
pub fn in_progress(&mut self, request: &PickBidRequest)
Conditionally changes the status to InProgress.
Runs validation:
Stops contract execution if the validation fails.
sourcepub fn cancel(&mut self, request: &CancelJobOfferRequest)
pub fn cancel(&mut self, request: &CancelJobOfferRequest)
Conditionally changes the status to Cancelled.
Runs validation:
Stops contract execution if any validation fails.
sourcepub fn auction_state(&self, block_time: BlockTime) -> AuctionState
pub fn auction_state(&self, block_time: BlockTime) -> AuctionState
Gets the auction state in a given time.
sourcepub fn configuration(&self) -> &Configuration
pub fn configuration(&self) -> &Configuration
Gets a reference to the job configuration.
pub fn slash(&mut self)
Trait Implementations§
source§impl BorshDeserialize for JobOffer
impl BorshDeserialize for JobOffer
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 JobOffer
impl Send for JobOffer
impl Sync for JobOffer
impl Unpin for JobOffer
impl UnwindSafe for JobOffer
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