Struct dao::bid_escrow::storage::BidStorage
source · pub struct BidStorage { /* private fields */ }
Expand description
Stores Bid-related variables and mappings.
Implementations§
source§impl BidStorage
impl BidStorage
sourcepub fn store_job_offer(&mut self, offer: JobOffer)
pub fn store_job_offer(&mut self, offer: JobOffer)
Writes an job offer to the storage.
sourcepub fn update_job_offer(&mut self, offer_id: &JobOfferId, offer: JobOffer)
pub fn update_job_offer(&mut self, offer_id: &JobOfferId, offer: JobOffer)
Updates the value under the offer_if
key.
sourcepub fn store_bid_id(&mut self, offer_id: JobOfferId, bid_id: BidId)
pub fn store_bid_id(&mut self, offer_id: JobOfferId, bid_id: BidId)
Writes a pair JobOfferId-BidId to the storage.
sourcepub fn get_job_offer(&self, job_offer_id: &JobOfferId) -> Option<JobOffer>
pub fn get_job_offer(&self, job_offer_id: &JobOfferId) -> Option<JobOffer>
Gets the total number of JobOffers.
sourcepub fn get_job_offer_or_revert(&self, job_offer_id: &JobOfferId) -> JobOffer
pub fn get_job_offer_or_revert(&self, job_offer_id: &JobOfferId) -> JobOffer
Gets the JobOffer with a given id or reverts with JobOfferNotFound.
sourcepub fn get_bid_or_revert(&self, bid_id: &BidId) -> Bid
pub fn get_bid_or_revert(&self, bid_id: &BidId) -> Bid
Gets the Bid with a given id or reverts with Error::BidNotFound.
sourcepub fn get_nth_bid(&self, offer_id: &JobOfferId, n: u32) -> Bid
pub fn get_nth_bid(&self, offer_id: &JobOfferId, n: u32) -> Bid
Gets the nth Bid for the JobOffer with a given id or reverts with Error::BidNotFound.
sourcepub fn job_offers_count(&self) -> u32
pub fn job_offers_count(&self) -> u32
Gets the total number of JobOffers.
sourcepub fn bids_count(&self) -> u32
pub fn bids_count(&self) -> u32
Gets the total number of Bids.
sourcepub fn next_bid_id(&mut self) -> BidId
pub fn next_bid_id(&mut self) -> BidId
Increments bid counter.
sourcepub fn next_job_offer_id(&mut self) -> JobOfferId
pub fn next_job_offer_id(&mut self) -> JobOfferId
Increments job offers counter.
sourcepub fn get_bids_count(&self, offer_id: &JobOfferId) -> u32
pub fn get_bids_count(&self, offer_id: &JobOfferId) -> u32
Gets the total number of JobOffers.
sourcepub fn get_job_offer_configuration(&self, job: &Job) -> Configuration
pub fn get_job_offer_configuration(&self, job: &Job) -> Configuration
Gets the Configuration of the Job.
pub fn add_to_active_offers(&mut self, job_offer_id: JobOfferId)
pub fn remove_from_active_offers(&mut self, job_offer_id: JobOfferId)
pub fn get_active_offers(&self) -> Vec<JobOfferId>
pub fn add_to_active_bids( &mut self, worker: Address, job_offer_id: JobOfferId, bid_id: BidId )
pub fn remove_from_active_bids( &mut self, worker: Address, job_offer_id: JobOfferId )
pub fn get_active_bid_id( &self, worker: Address, job_offer_id: JobOfferId ) -> Option<BidId>
Trait Implementations§
source§impl Clone for BidStorage
impl Clone for BidStorage
source§fn clone(&self) -> BidStorage
fn clone(&self) -> BidStorage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Node for BidStorage
impl Node for BidStorage
Auto Trait Implementations§
impl RefUnwindSafe for BidStorage
impl Send for BidStorage
impl Sync for BidStorage
impl Unpin for BidStorage
impl UnwindSafe for BidStorage
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