#[non_exhaustive]pub struct RecommendResponse {
pub results: Vec<RecommendationResult>,
pub attribution_token: String,
pub missing_ids: Vec<String>,
pub validate_only: bool,
/* private fields */
}Available on crate feature
recommendation-service only.Expand description
Response message for Recommend 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<RecommendationResult>A list of recommended Documents. The order represents the ranking (from the most relevant Document 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 documents in the request that were missing from the default Branch associated with the requested ServingConfig.
validate_only: boolTrue if RecommendRequest.validate_only was set.
Implementations§
Source§impl RecommendResponse
impl RecommendResponse
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 = RecommendResponse::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 = RecommendResponse::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
Sets the value of validate_only.
§Example
ⓘ
let x = RecommendResponse::new().set_validate_only(true);Trait Implementations§
Source§impl Clone for RecommendResponse
impl Clone for RecommendResponse
Source§fn clone(&self) -> RecommendResponse
fn clone(&self) -> RecommendResponse
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 RecommendResponse
impl Debug for RecommendResponse
Source§impl Default for RecommendResponse
impl Default for RecommendResponse
Source§fn default() -> RecommendResponse
fn default() -> RecommendResponse
Returns the “default value” for a type. Read more
Source§impl Message for RecommendResponse
impl Message for RecommendResponse
Source§impl PartialEq for RecommendResponse
impl PartialEq for RecommendResponse
impl StructuralPartialEq for RecommendResponse
Auto Trait Implementations§
impl Freeze for RecommendResponse
impl RefUnwindSafe for RecommendResponse
impl Send for RecommendResponse
impl Sync for RecommendResponse
impl Unpin for RecommendResponse
impl UnwindSafe for RecommendResponse
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