Struct primitives::AdUnit
source · pub struct AdUnit {
pub ipfs: IPFS,
pub ad_type: String,
pub media_url: String,
pub media_mime: String,
pub target_url: String,
pub min_targeting_score: Option<f64>,
pub owner: ValidatorId,
pub created: DateTime<Utc>,
pub title: Option<String>,
pub description: Option<String>,
pub archived: bool,
pub modified: Option<DateTime<Utc>>,
}
Fields
ipfs: IPFS
valid ipfs hash of spec props below
ad_type: String
the type of the ad unit currently, possible values are: legacy_300x250, legacy_250x250, legacy_240x400, legacy_336x280, legacy_180x150, legacy_300x100, legacy_720x300, legacy_468x60, legacy_234x60, legacy_88x31, legacy_120x90, legacy_120x60, legacy_120x240, legacy_125x125, legacy_728x90, legacy_160x600, legacy_120x600, legacy_300x600 see IAB ad unit guidelines and iab_flex_{adUnitName} (see IAB’s new ad portfolio and PDF)
media_url: String
a URL to the resource (usually PNG); must use the ipfs:// protocol, to guarantee data immutability
media_mime: String
MIME type of the media, possible values at the moment are: image/jpeg, image/png
target_url: String
Advertised URL
min_targeting_score: Option<f64>
Number; minimum targeting score (optional)
owner: ValidatorId
user address from the session
created: DateTime<Utc>
number, UTC timestamp in milliseconds, used as nonce for escaping duplicated spec ipfs hashes
title: Option<String>
the name of the unit used in platform UI
description: Option<String>
arbitrary text used in platform UI
archived: bool
user can change it - used for filtering in platform UI
modified: Option<DateTime<Utc>>
UTC timestamp in milliseconds, changed every time modifiable property is changed
Trait Implementations
sourceimpl<'de> Deserialize<'de> for AdUnit
impl<'de> Deserialize<'de> for AdUnit
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>,
sourceimpl<'a> FromSql<'a> for AdUnit
impl<'a> FromSql<'a> for AdUnit
sourcefn from_sql(
ty: &Type,
raw: &'a [u8]
) -> Result<Self, Box<dyn Error + Sync + Send>>
fn from_sql(
ty: &Type,
raw: &'a [u8]
) -> Result<Self, Box<dyn Error + Sync + Send>>
Type
in its binary format. Read moresourcefn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Type
. Read moresourceimpl ToSql for AdUnit
impl ToSql for AdUnit
sourcefn to_sql(
&self,
ty: &Type,
w: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql(
&self,
ty: &Type,
w: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
self
into the binary format of the specified
Postgres Type
, appending it to out
. Read moresourcefn accepts(ty: &Type) -> bool
fn accepts(ty: &Type) -> bool
Type
. Read moresourcefn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
fn to_sql_checked(
&self,
ty: &Type,
out: &mut BytesMut
) -> Result<IsNull, Box<dyn Error + Sync + Send>>
sourcefn encode_format(&self, _ty: &Type) -> Format
fn encode_format(&self, _ty: &Type) -> Format
impl StructuralPartialEq for AdUnit
Auto Trait Implementations
impl RefUnwindSafe for AdUnit
impl Send for AdUnit
impl Sync for AdUnit
impl Unpin for AdUnit
impl UnwindSafe for AdUnit
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
sourceimpl<T> BorrowToSql for Twhere
T: ToSql,
impl<T> BorrowToSql for Twhere
T: ToSql,
sourcefn borrow_to_sql(&self) -> &dyn ToSql
fn borrow_to_sql(&self) -> &dyn ToSql
self
as a ToSql
trait object.