#[non_exhaustive]pub struct SearchLinkPromotion {
pub title: String,
pub uri: String,
pub document: String,
pub image_uri: String,
pub description: String,
pub enabled: bool,
/* private fields */
}Available on crate features
control-service or conversational-search-service or search-service only.Expand description
Promotion proto includes uri and other helping information to display the promotion.
Fields (Non-exhaustive)§
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.title: StringRequired. The title of the promotion. Maximum length: 160 characters.
uri: StringOptional. The URL for the page the user wants to promote. Must be set for site search. For other verticals, this is optional.
document: StringOptional. The Document the user wants to promote. For site search, leave unset and only populate uri. Can be set along with uri.
image_uri: StringOptional. The promotion thumbnail image url.
description: StringOptional. The Promotion description. Maximum length: 200 characters.
enabled: boolOptional. The enabled promotion will be returned for any serving configs associated with the parent of the control this promotion is attached to.
This flag is used for basic site search only.
Implementations§
Source§impl SearchLinkPromotion
impl SearchLinkPromotion
pub fn new() -> Self
Sourcepub fn set_document<T: Into<String>>(self, v: T) -> Self
pub fn set_document<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_image_uri<T: Into<String>>(self, v: T) -> Self
pub fn set_image_uri<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_description<T: Into<String>>(self, v: T) -> Self
pub fn set_description<T: Into<String>>(self, v: T) -> Self
Sets the value of description.
§Example
ⓘ
let x = SearchLinkPromotion::new().set_description("example");Trait Implementations§
Source§impl Clone for SearchLinkPromotion
impl Clone for SearchLinkPromotion
Source§fn clone(&self) -> SearchLinkPromotion
fn clone(&self) -> SearchLinkPromotion
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SearchLinkPromotion
impl Debug for SearchLinkPromotion
Source§impl Default for SearchLinkPromotion
impl Default for SearchLinkPromotion
Source§fn default() -> SearchLinkPromotion
fn default() -> SearchLinkPromotion
Returns the “default value” for a type. Read more
Source§impl Message for SearchLinkPromotion
impl Message for SearchLinkPromotion
Source§impl PartialEq for SearchLinkPromotion
impl PartialEq for SearchLinkPromotion
impl StructuralPartialEq for SearchLinkPromotion
Auto Trait Implementations§
impl Freeze for SearchLinkPromotion
impl RefUnwindSafe for SearchLinkPromotion
impl Send for SearchLinkPromotion
impl Sync for SearchLinkPromotion
impl Unpin for SearchLinkPromotion
impl UnwindSafe for SearchLinkPromotion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more