Struct primitives::campaign::Campaign
source · pub struct Campaign {
pub id: CampaignId,
pub channel: Channel,
pub creator: Address,
pub budget: UnifiedNum,
pub validators: Validators,
pub title: Option<String>,
pub pricing_bounds: PricingBounds,
pub event_submission: Option<EventSubmission>,
pub ad_units: Vec<AdUnit>,
pub targeting_rules: Rules,
pub created: DateTime<Utc>,
pub active: Active,
}
Fields
id: CampaignId
channel: Channel
creator: Address
budget: UnifiedNum
validators: Validators
title: Option<String>
pricing_bounds: PricingBounds
Events pricing bounds, per 1 event
event_submission: Option<EventSubmission>
EventSubmission object, applied to event submission
ad_units: Vec<AdUnit>
An array of AdUnit (optional)
targeting_rules: Rules
created: DateTime<Utc>
A millisecond timestamp of when the campaign was created
active: Active
Used by the AdViewManager & Targeting AIP#31
Implementations
sourceimpl Campaign
impl Campaign
pub fn find_validator(
&self,
validator: &ValidatorId
) -> Option<Validator<&ValidatorDesc>>
sourcepub fn leader(&self) -> Option<&ValidatorDesc>
pub fn leader(&self) -> Option<&ValidatorDesc>
Matches the Channel.leader to the Campaign.validators.leader
If they match it returns Some
, otherwise, it returns None
sourcepub fn follower(&self) -> Option<&ValidatorDesc>
pub fn follower(&self) -> Option<&ValidatorDesc>
Matches the Channel.follower to the Campaign.spec.follower
If they match it returns Some
, otherwise, it returns None
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Campaign
impl<'de> Deserialize<'de> for Campaign
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Campaign
Auto Trait Implementations
impl RefUnwindSafe for Campaign
impl Send for Campaign
impl Sync for Campaign
impl Unpin for Campaign
impl UnwindSafe for Campaign
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more