Struct primitives::targeting::Input
source · pub struct Input {
pub ad_view: Option<AdView>,
pub global: Global,
pub campaign: Option<GetCampaign>,
pub balances: Option<GetBalances>,
pub ad_unit_id: Option<IPFS>,
pub ad_slot: Option<AdSlot>,
}
Expand description
Input is deserializable from the struct, however we should be careful, since all the fields should align with the enum Field
Fields
ad_view: Option<AdView>
AdView scope, accessible only on the AdView
global: Global
Global scope, accessible everywhere
campaign: Option<GetCampaign>
balances: Option<GetBalances>
ad_unit_id: Option<IPFS>
ad_slot: Option<AdSlot>
adSlot scope, accessible on Supermarket and AdView
Implementations
sourceimpl Input
impl Input
sourcepub fn with_campaign(self, campaign: Campaign) -> Self
pub fn with_campaign(self, campaign: Campaign) -> Self
Sets the Channel Getter
pub fn with_balances(self, balances: UnifiedMap) -> Self
sourcepub fn try_get(&self, field: &str) -> Result<Value, Error>
pub fn try_get(&self, field: &str) -> Result<Value, Error>
This method will try to parse the Field
from the string
then it will get the field value, but there isn’t one,
it will return Error::UnknownVariable
, otherwise it will return the value
pub fn to_map(&self) -> Map
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Input
impl<'de> Deserialize<'de> for Input
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 Input
Auto Trait Implementations
impl RefUnwindSafe for Input
impl Send for Input
impl Sync for Input
impl Unpin for Input
impl UnwindSafe for Input
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