#[non_exhaustive]pub struct BoostAction {
pub boost: f32,
pub filter: String,
pub data_store: String,
pub boost_spec: Option<BoostSpec>,
/* private fields */
}control-service only.Expand description
Adjusts order of products in returned list.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.boost: f32Strength of the boost, which should be in [-1, 1]. Negative boost means demotion. Default is 0.0 (No-op).
filter: StringRequired. Specifies which products to apply the boost to.
If no filter is provided all products will be boosted (No-op). Syntax documentation: https://cloud.google.com/retail/docs/filter-and-order Maximum length is 5000 characters. Otherwise an INVALID ARGUMENT error is thrown.
data_store: StringRequired. Specifies which data store’s documents can be boosted by this control. Full data store name e.g. projects/123/locations/global/collections/default_collection/dataStores/default_data_store
boost_spec: Option<BoostSpec>Constant value boost or custom ranking based boost specifications.
Implementations§
Source§impl BoostAction
impl BoostAction
Sourcepub fn set_filter<T: Into<String>>(self, v: T) -> Self
pub fn set_filter<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_data_store<T: Into<String>>(self, v: T) -> Self
pub fn set_data_store<T: Into<String>>(self, v: T) -> Self
Sets the value of data_store.
§Example
let x = BoostAction::new().set_data_store(format!("projects/{project_id}/locations/{location_id}/dataStores/{data_store_id}"));Sourcepub fn set_boost_spec<T: Into<Option<BoostSpec>>>(self, v: T) -> Self
pub fn set_boost_spec<T: Into<Option<BoostSpec>>>(self, v: T) -> Self
Sets the value of boost_spec.
Note that all the setters affecting boost_spec are mutually
exclusive.
§Example
use google_cloud_discoveryengine_v1::model::control::boost_action::BoostSpec;
let x = BoostAction::new().set_boost_spec(Some(BoostSpec::FixedBoost(42.0)));Sourcepub fn fixed_boost(&self) -> Option<&f32>
pub fn fixed_boost(&self) -> Option<&f32>
The value of boost_spec
if it holds a FixedBoost, None if the field is not set or
holds a different branch.
Sourcepub fn set_fixed_boost<T: Into<f32>>(self, v: T) -> Self
pub fn set_fixed_boost<T: Into<f32>>(self, v: T) -> Self
Sets the value of boost_spec
to hold a FixedBoost.
Note that all the setters affecting boost_spec are
mutually exclusive.
§Example
let x = BoostAction::new().set_fixed_boost(42.0);
assert!(x.fixed_boost().is_some());
assert!(x.interpolation_boost_spec().is_none());Sourcepub fn interpolation_boost_spec(&self) -> Option<&Box<InterpolationBoostSpec>>
pub fn interpolation_boost_spec(&self) -> Option<&Box<InterpolationBoostSpec>>
The value of boost_spec
if it holds a InterpolationBoostSpec, None if the field is not set or
holds a different branch.
Sourcepub fn set_interpolation_boost_spec<T: Into<Box<InterpolationBoostSpec>>>(
self,
v: T,
) -> Self
pub fn set_interpolation_boost_spec<T: Into<Box<InterpolationBoostSpec>>>( self, v: T, ) -> Self
Sets the value of boost_spec
to hold a InterpolationBoostSpec.
Note that all the setters affecting boost_spec are
mutually exclusive.
§Example
use google_cloud_discoveryengine_v1::model::control::boost_action::InterpolationBoostSpec;
let x = BoostAction::new().set_interpolation_boost_spec(InterpolationBoostSpec::default()/* use setters */);
assert!(x.interpolation_boost_spec().is_some());
assert!(x.fixed_boost().is_none());Trait Implementations§
Source§impl Clone for BoostAction
impl Clone for BoostAction
Source§fn clone(&self) -> BoostAction
fn clone(&self) -> BoostAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BoostAction
impl Debug for BoostAction
Source§impl Default for BoostAction
impl Default for BoostAction
Source§fn default() -> BoostAction
fn default() -> BoostAction
Source§impl Message for BoostAction
impl Message for BoostAction
Source§impl PartialEq for BoostAction
impl PartialEq for BoostAction
impl StructuralPartialEq for BoostAction
Auto Trait Implementations§
impl Freeze for BoostAction
impl RefUnwindSafe for BoostAction
impl Send for BoostAction
impl Sync for BoostAction
impl Unpin for BoostAction
impl UnsafeUnpin for BoostAction
impl UnwindSafe for BoostAction
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request