#[non_exhaustive]pub struct PredictResponse {
pub results: Vec<PredictionResult>,
pub attribution_token: String,
pub missing_ids: Vec<String>,
pub validate_only: bool,
/* private fields */
}Expand description
Response message for predict method.
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.results: Vec<PredictionResult>A list of recommended products. The order represents the ranking (from the most relevant product to the least).
attribution_token: StringA unique attribution token. This should be included in the UserEvent logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.
missing_ids: Vec<String>IDs of products in the request that were missing from the inventory.
validate_only: boolTrue if the validateOnly property was set in the request.
Implementations§
Source§impl PredictResponse
impl PredictResponse
pub fn new() -> Self
Sourcepub fn set_results<T, V>(self, v: T) -> Self
pub fn set_results<T, V>(self, v: T) -> Self
Sourcepub fn set_attribution_token<T: Into<String>>(self, v: T) -> Self
pub fn set_attribution_token<T: Into<String>>(self, v: T) -> Self
Sets the value of attribution_token.
§Example
ⓘ
let x = PredictResponse::new().set_attribution_token("example");Sourcepub fn set_missing_ids<T, V>(self, v: T) -> Self
pub fn set_missing_ids<T, V>(self, v: T) -> Self
Sets the value of missing_ids.
§Example
ⓘ
let x = PredictResponse::new().set_missing_ids(["a", "b", "c"]);Sourcepub fn set_validate_only<T: Into<bool>>(self, v: T) -> Self
pub fn set_validate_only<T: Into<bool>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for PredictResponse
impl Clone for PredictResponse
Source§fn clone(&self) -> PredictResponse
fn clone(&self) -> PredictResponse
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 PredictResponse
impl Debug for PredictResponse
Source§impl Default for PredictResponse
impl Default for PredictResponse
Source§fn default() -> PredictResponse
fn default() -> PredictResponse
Returns the “default value” for a type. Read more
Source§impl Message for PredictResponse
impl Message for PredictResponse
Source§impl PartialEq for PredictResponse
impl PartialEq for PredictResponse
impl StructuralPartialEq for PredictResponse
Auto Trait Implementations§
impl Freeze for PredictResponse
impl RefUnwindSafe for PredictResponse
impl Send for PredictResponse
impl Sync for PredictResponse
impl Unpin for PredictResponse
impl UnwindSafe for PredictResponse
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