Struct Image Copy item path Source #[non_exhaustive]
pub struct Image {
pub uri: String ,
pub height: i32 ,
pub width: i32 ,
}Expand description Product image. Recommendations AI and
Retail Search use product images to improve prediction and search results.
Product images can be returned in results, and are shown in prediction or
search previews in the console. Please try to provide correct product images
and avoid using images with size too small.
This struct is marked as non-exhaustive Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
Required. URI of the image.
This field must be a valid UTF-8 encoded URI with a length limit of 5,000
characters. Otherwise, an INVALID_ARGUMENT error is returned.
Google Merchant Center property
image_link .
Schema.org property Product.image .
Height of the image in number of pixels.
This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
returned.
Width of the image in number of pixels.
This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is
returned.
Creates a new default instance.
Sets the value of uri .
§ Example
ⓘ let x = Image::new().set_uri("example" );Sets the value of height .
§ Example
ⓘ let x = Image::new().set_height(42 );Sets the value of width .
§ Example
ⓘ let x = Image::new().set_width(42 );Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Returns the “default value” for a type.
Read more The typename of this message.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Attaches the provided
Context to this type, returning a
WithContext
wrapper.
Read more Attaches the current
Context to this type, returning a
WithContext
wrapper.
Read more Instruments this type with the provided
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 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.