Companion

Struct Companion 

Source
pub struct Companion<'a> {
Show 20 fields pub id: Option<Cow<'a, str>>, pub width: i32, pub height: i32, pub asset_width: Option<i32>, pub asset_height: Option<i32>, pub expanded_width: Option<i32>, pub expanded_height: Option<i32>, pub api_framework: Option<Cow<'a, str>>, pub ad_slot_id: Option<Cow<'a, str>>, pub pxratio: Option<f32>, pub rendering_mode: Option<RenderingMode>, pub html_resources: Vec<Cow<'a, str>>, pub iframe_resources: Vec<Cow<'a, str>>, pub static_resources: Vec<StaticResource<'a>>, pub ad_parameters: Option<AdParameters<'a>>, pub alt_text: Option<Cow<'a, str>>, pub companion_click_through: Option<Cow<'a, str>>, pub companion_click_trackings: Vec<CompanionClickTracking<'a>>, pub creative_extensiosn: Option<CreativeExtensions>, pub tracking_events: Option<TrackingEvents<'a>>,
}
Expand description

The resource elements for providing creative resources.

<xs:complexType name="Companion">
  <!-- CreativeResource_type -->
  <xs:sequence>
    <xs:element name="HTMLResource" minOccurs="0" maxOccurs="unbounded" type="vast:HTMLResource_type">
    <xs:element name="IFrameResource" minOccurs="0" maxOccurs="unbounded" type="xs:anyURI">
    <xs:element name="StaticResource" minOccurs="0" maxOccurs="unbounded">
  </xs:sequence>

  <xs:attribute name="id" type="xs:string" use="optional">
  <xs:attribute name="width" type="xs:integer" use="required">
  <xs:attribute name="height" type="xs:integer" use="required">
  <xs:attribute name="assetWidth" type="xs:integer" use="optional">
  <xs:attribute name="assetHeight" type="xs:integer" use="optional">
  <xs:attribute name="expandedWidth" type="xs:integer" use="optional">
  <xs:attribute name="expandedHeight" type="xs:integer" use="optional">
  <xs:attribute name="apiFramework" type="xs:string" use="optional">
  <xs:attribute name="adSlotId" type="xs:string" use="optional">
  <xs:attribute name="pxratio" type="xs:decimal">
  <xs:attribute name="renderingMode" use="optional">
  <xs:sequence>
    <xs:element name="AdParameters" minOccurs="0" maxOccurs="1" type="vast:AdParameters_type">
    <xs:element name="AltText" minOccurs="0" maxOccurs="1" type="xs:string">
    <xs:element name="CompanionClickThrough" minOccurs="0" maxOccurs="1" type="xs:anyURI">
    <xs:element name="CompanionClickTracking" minOccurs="0" maxOccurs="unbounded">
    <xs:element name="CreativeExtensions" minOccurs="0" maxOccurs="1" type="vast:CreativeExtensions_type" />
    <xs:element name="TrackingEvents" minOccurs="0" maxOccurs="1" type="vast:TrackingEvents_type">
  </xs:sequence>
</xs:complexType>

Fields§

§id: Option<Cow<'a, str>>

An optional identifier for the creative.

§width: i32

An optional identifier for the creative.

§height: i32

The pixel height of the placement slot for which the creative is intended.

§asset_width: Option<i32>

The pixel width of the creative.

§asset_height: Option<i32>

The pixel height of the creative.

§expanded_width: Option<i32>

The maximum pixel width of the creative in its expanded state.

§expanded_height: Option<i32>

The maximum pixel height of the creative in its expanded state.

§api_framework: Option<Cow<'a, str>>

The API necessary to communicate with the creative if available.

§ad_slot_id: Option<Cow<'a, str>>

Used to identify desired placement on a publisher’s page. Values to be used should be discussed between publishers and advertisers.

§pxratio: Option<f32>

The pixel ratio for which the companion creative is intended. The pixel ratio is the ratio of physical pixels on the device to the device-independent pixels. An ad intended for display on a device with a pixel ratio that is twice that of a standard 1:1 pixel ratio would use the value “2.” Default value is “1.”

§rendering_mode: Option<RenderingMode>

Used to indicate when and where to use this companion ad. Values can be “default” or “end-card” or “concurrent”. If this field is empty or not given, “default” will be used.

§html_resources: Vec<Cow<'a, str>>

The container for zero or more <HTMLResource> elements.

§iframe_resources: Vec<Cow<'a, str>>

The container for zero or more <IFrameResource> elements.

§static_resources: Vec<StaticResource<'a>>

The container for zero or more <StaticResource> elements.

§ad_parameters: Option<AdParameters<'a>>

The container for zero or one <AdParameters> element.

§alt_text: Option<Cow<'a, str>>

The container for zero or one <AltText> element.

§companion_click_through: Option<Cow<'a, str>>

The container for zero or one <CompanionClickThrough> element.

§companion_click_trackings: Vec<CompanionClickTracking<'a>>

The container for zero or more <CompanionClickTracking> elements.

§creative_extensiosn: Option<CreativeExtensions>

The container for zero or more <CreativeExtensions> element.

§tracking_events: Option<TrackingEvents<'a>>

The container for zero or one <TrackingEvents>(TrackingEvents) element.

Trait Implementations§

Source§

impl<'a> Clone for Companion<'a>

Source§

fn clone(&self) -> Companion<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Companion<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for Companion<'a>

Source§

fn default() -> Companion<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> PartialEq for Companion<'a>

Source§

fn eq(&self, other: &Companion<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'__input: 'a, 'a> XmlRead<'__input> for Companion<'a>

Source§

fn from_reader(reader: &mut XmlReader<'__input>) -> XmlResult<Self>

Source§

fn from_str(text: &'a str) -> Result<Self, XmlError>

Source§

impl<'a> XmlWrite for Companion<'a>

Source§

fn to_writer<W: Write>(&self, writer: &mut XmlWriter<W>) -> XmlResult<()>

Source§

fn to_string(&self) -> Result<String, XmlError>

Source§

impl<'a> StructuralPartialEq for Companion<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Companion<'a>

§

impl<'a> RefUnwindSafe for Companion<'a>

§

impl<'a> Send for Companion<'a>

§

impl<'a> Sync for Companion<'a>

§

impl<'a> Unpin for Companion<'a>

§

impl<'a> UnwindSafe for Companion<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> XmlReadOwned for T
where T: for<'s> XmlRead<'s>,