#[non_exhaustive]pub struct SearchSpec {
pub input: Option<Input>,
/* private fields */
}Available on crate feature
conversational-search-service only.Expand description
Search specification.
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.input: Option<Input>Search parameters to control the search behavior. Or provide search result list to generate answer.
Implementations§
Source§impl SearchSpec
impl SearchSpec
pub fn new() -> Self
Sourcepub fn set_input<T: Into<Option<Input>>>(self, v: T) -> Self
pub fn set_input<T: Into<Option<Input>>>(self, v: T) -> Self
Sets the value of input.
Note that all the setters affecting input are mutually
exclusive.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::answer_query_request::search_spec::SearchParams;
let x = SearchSpec::new().set_input(Some(
google_cloud_discoveryengine_v1::model::answer_query_request::search_spec::Input::SearchParams(SearchParams::default().into())));Sourcepub fn search_params(&self) -> Option<&Box<SearchParams>>
pub fn search_params(&self) -> Option<&Box<SearchParams>>
The value of input
if it holds a SearchParams, None if the field is not set or
holds a different branch.
Sourcepub fn set_search_params<T: Into<Box<SearchParams>>>(self, v: T) -> Self
pub fn set_search_params<T: Into<Box<SearchParams>>>(self, v: T) -> Self
Sets the value of input
to hold a SearchParams.
Note that all the setters affecting input are
mutually exclusive.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::answer_query_request::search_spec::SearchParams;
let x = SearchSpec::new().set_search_params(SearchParams::default()/* use setters */);
assert!(x.search_params().is_some());
assert!(x.search_result_list().is_none());Sourcepub fn search_result_list(&self) -> Option<&Box<SearchResultList>>
pub fn search_result_list(&self) -> Option<&Box<SearchResultList>>
The value of input
if it holds a SearchResultList, None if the field is not set or
holds a different branch.
Sourcepub fn set_search_result_list<T: Into<Box<SearchResultList>>>(
self,
v: T,
) -> Self
pub fn set_search_result_list<T: Into<Box<SearchResultList>>>( self, v: T, ) -> Self
Sets the value of input
to hold a SearchResultList.
Note that all the setters affecting input are
mutually exclusive.
§Example
ⓘ
use google_cloud_discoveryengine_v1::model::answer_query_request::search_spec::SearchResultList;
let x = SearchSpec::new().set_search_result_list(SearchResultList::default()/* use setters */);
assert!(x.search_result_list().is_some());
assert!(x.search_params().is_none());Trait Implementations§
Source§impl Clone for SearchSpec
impl Clone for SearchSpec
Source§fn clone(&self) -> SearchSpec
fn clone(&self) -> SearchSpec
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 SearchSpec
impl Debug for SearchSpec
Source§impl Default for SearchSpec
impl Default for SearchSpec
Source§fn default() -> SearchSpec
fn default() -> SearchSpec
Returns the “default value” for a type. Read more
Source§impl PartialEq for SearchSpec
impl PartialEq for SearchSpec
impl StructuralPartialEq for SearchSpec
Auto Trait Implementations§
impl Freeze for SearchSpec
impl RefUnwindSafe for SearchSpec
impl Send for SearchSpec
impl Sync for SearchSpec
impl Unpin for SearchSpec
impl UnwindSafe for SearchSpec
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