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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Creates a new value of this type from a buffer of data of the specified Postgres Type in its binary format. Read more
Determines if a value of this type can be created from the specified Postgres Type. Read more
Creates a new value of this type from a NULL SQL value. Read more
A convenience function that delegates to from_sql and from_sql_null depending on the value of raw. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more
Converts the value of self into the binary format of the specified Postgres Type, appending it to out. Read more
Determines if a value of this type can be converted to the specified Postgres Type. Read more
An adaptor method used internally by Rust-Postgres. Read more
Specify the encode format

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Returns a reference to self as a ToSql trait object.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more