#[non_exhaustive]pub struct QueryResultItemBuilder { /* private fields */ }
Expand description
A builder for QueryResultItem
.
Implementations§
Source§impl QueryResultItemBuilder
impl QueryResultItemBuilder
Sourcepub fn id(self, input: impl Into<String>) -> Self
pub fn id(self, input: impl Into<String>) -> Self
The unique identifier for the query result item id (Id
) and the query result item document id (DocumentId
) combined. The value of this field changes with every request, even when you have the same documents.
Sourcepub fn set_id(self, input: Option<String>) -> Self
pub fn set_id(self, input: Option<String>) -> Self
The unique identifier for the query result item id (Id
) and the query result item document id (DocumentId
) combined. The value of this field changes with every request, even when you have the same documents.
Sourcepub fn get_id(&self) -> &Option<String>
pub fn get_id(&self) -> &Option<String>
The unique identifier for the query result item id (Id
) and the query result item document id (DocumentId
) combined. The value of this field changes with every request, even when you have the same documents.
Sourcepub fn type(self, input: QueryResultType) -> Self
pub fn type(self, input: QueryResultType) -> Self
The type of document within the response. For example, a response could include a question-answer that's relevant to the query.
Sourcepub fn set_type(self, input: Option<QueryResultType>) -> Self
pub fn set_type(self, input: Option<QueryResultType>) -> Self
The type of document within the response. For example, a response could include a question-answer that's relevant to the query.
Sourcepub fn get_type(&self) -> &Option<QueryResultType>
pub fn get_type(&self) -> &Option<QueryResultType>
The type of document within the response. For example, a response could include a question-answer that's relevant to the query.
Sourcepub fn format(self, input: QueryResultFormat) -> Self
pub fn format(self, input: QueryResultFormat) -> Self
If the Type
of document within the response is ANSWER
, then it is either a TABLE
answer or TEXT
answer. If it's a table answer, a table excerpt is returned in TableExcerpt
. If it's a text answer, a text excerpt is returned in DocumentExcerpt
.
Sourcepub fn set_format(self, input: Option<QueryResultFormat>) -> Self
pub fn set_format(self, input: Option<QueryResultFormat>) -> Self
If the Type
of document within the response is ANSWER
, then it is either a TABLE
answer or TEXT
answer. If it's a table answer, a table excerpt is returned in TableExcerpt
. If it's a text answer, a text excerpt is returned in DocumentExcerpt
.
Sourcepub fn get_format(&self) -> &Option<QueryResultFormat>
pub fn get_format(&self) -> &Option<QueryResultFormat>
If the Type
of document within the response is ANSWER
, then it is either a TABLE
answer or TEXT
answer. If it's a table answer, a table excerpt is returned in TableExcerpt
. If it's a text answer, a text excerpt is returned in DocumentExcerpt
.
Sourcepub fn additional_attributes(self, input: AdditionalResultAttribute) -> Self
pub fn additional_attributes(self, input: AdditionalResultAttribute) -> Self
Appends an item to additional_attributes
.
To override the contents of this collection use set_additional_attributes
.
One or more additional fields/attributes associated with the query result.
Sourcepub fn set_additional_attributes(
self,
input: Option<Vec<AdditionalResultAttribute>>,
) -> Self
pub fn set_additional_attributes( self, input: Option<Vec<AdditionalResultAttribute>>, ) -> Self
One or more additional fields/attributes associated with the query result.
Sourcepub fn get_additional_attributes(
&self,
) -> &Option<Vec<AdditionalResultAttribute>>
pub fn get_additional_attributes( &self, ) -> &Option<Vec<AdditionalResultAttribute>>
One or more additional fields/attributes associated with the query result.
Sourcepub fn document_id(self, input: impl Into<String>) -> Self
pub fn document_id(self, input: impl Into<String>) -> Self
The identifier for the document.
Sourcepub fn set_document_id(self, input: Option<String>) -> Self
pub fn set_document_id(self, input: Option<String>) -> Self
The identifier for the document.
Sourcepub fn get_document_id(&self) -> &Option<String>
pub fn get_document_id(&self) -> &Option<String>
The identifier for the document.
Sourcepub fn document_title(self, input: TextWithHighlights) -> Self
pub fn document_title(self, input: TextWithHighlights) -> Self
The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.
Sourcepub fn set_document_title(self, input: Option<TextWithHighlights>) -> Self
pub fn set_document_title(self, input: Option<TextWithHighlights>) -> Self
The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.
Sourcepub fn get_document_title(&self) -> &Option<TextWithHighlights>
pub fn get_document_title(&self) -> &Option<TextWithHighlights>
The title of the document. Contains the text of the title and information for highlighting the relevant terms in the title.
Sourcepub fn document_excerpt(self, input: TextWithHighlights) -> Self
pub fn document_excerpt(self, input: TextWithHighlights) -> Self
An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.
Sourcepub fn set_document_excerpt(self, input: Option<TextWithHighlights>) -> Self
pub fn set_document_excerpt(self, input: Option<TextWithHighlights>) -> Self
An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.
Sourcepub fn get_document_excerpt(&self) -> &Option<TextWithHighlights>
pub fn get_document_excerpt(&self) -> &Option<TextWithHighlights>
An extract of the text in the document. Contains information about highlighting the relevant terms in the excerpt.
Sourcepub fn document_uri(self, input: impl Into<String>) -> Self
pub fn document_uri(self, input: impl Into<String>) -> Self
The URI of the original location of the document.
Sourcepub fn set_document_uri(self, input: Option<String>) -> Self
pub fn set_document_uri(self, input: Option<String>) -> Self
The URI of the original location of the document.
Sourcepub fn get_document_uri(&self) -> &Option<String>
pub fn get_document_uri(&self) -> &Option<String>
The URI of the original location of the document.
Sourcepub fn document_attributes(self, input: DocumentAttribute) -> Self
pub fn document_attributes(self, input: DocumentAttribute) -> Self
Appends an item to document_attributes
.
To override the contents of this collection use set_document_attributes
.
An array of document fields/attributes assigned to a document in the search results. For example, the document author (_author
) or the source URI (_source_uri
) of the document.
Sourcepub fn set_document_attributes(
self,
input: Option<Vec<DocumentAttribute>>,
) -> Self
pub fn set_document_attributes( self, input: Option<Vec<DocumentAttribute>>, ) -> Self
An array of document fields/attributes assigned to a document in the search results. For example, the document author (_author
) or the source URI (_source_uri
) of the document.
Sourcepub fn get_document_attributes(&self) -> &Option<Vec<DocumentAttribute>>
pub fn get_document_attributes(&self) -> &Option<Vec<DocumentAttribute>>
An array of document fields/attributes assigned to a document in the search results. For example, the document author (_author
) or the source URI (_source_uri
) of the document.
Sourcepub fn score_attributes(self, input: ScoreAttributes) -> Self
pub fn score_attributes(self, input: ScoreAttributes) -> Self
Indicates the confidence level of Amazon Kendra providing a relevant result for the query. Each result is placed into a bin that indicates the confidence, VERY_HIGH
, HIGH
, MEDIUM
and LOW
. You can use the score to determine if a response meets the confidence needed for your application.
The field is only set to LOW
when the Type
field is set to DOCUMENT
and Amazon Kendra is not confident that the result is relevant to the query.
Sourcepub fn set_score_attributes(self, input: Option<ScoreAttributes>) -> Self
pub fn set_score_attributes(self, input: Option<ScoreAttributes>) -> Self
Indicates the confidence level of Amazon Kendra providing a relevant result for the query. Each result is placed into a bin that indicates the confidence, VERY_HIGH
, HIGH
, MEDIUM
and LOW
. You can use the score to determine if a response meets the confidence needed for your application.
The field is only set to LOW
when the Type
field is set to DOCUMENT
and Amazon Kendra is not confident that the result is relevant to the query.
Sourcepub fn get_score_attributes(&self) -> &Option<ScoreAttributes>
pub fn get_score_attributes(&self) -> &Option<ScoreAttributes>
Indicates the confidence level of Amazon Kendra providing a relevant result for the query. Each result is placed into a bin that indicates the confidence, VERY_HIGH
, HIGH
, MEDIUM
and LOW
. You can use the score to determine if a response meets the confidence needed for your application.
The field is only set to LOW
when the Type
field is set to DOCUMENT
and Amazon Kendra is not confident that the result is relevant to the query.
Sourcepub fn feedback_token(self, input: impl Into<String>) -> Self
pub fn feedback_token(self, input: impl Into<String>) -> Self
A token that identifies a particular result from a particular query. Use this token to provide click-through feedback for the result. For more information, see Submitting feedback.
Sourcepub fn set_feedback_token(self, input: Option<String>) -> Self
pub fn set_feedback_token(self, input: Option<String>) -> Self
A token that identifies a particular result from a particular query. Use this token to provide click-through feedback for the result. For more information, see Submitting feedback.
Sourcepub fn get_feedback_token(&self) -> &Option<String>
pub fn get_feedback_token(&self) -> &Option<String>
A token that identifies a particular result from a particular query. Use this token to provide click-through feedback for the result. For more information, see Submitting feedback.
Sourcepub fn table_excerpt(self, input: TableExcerpt) -> Self
pub fn table_excerpt(self, input: TableExcerpt) -> Self
An excerpt from a table within a document.
Sourcepub fn set_table_excerpt(self, input: Option<TableExcerpt>) -> Self
pub fn set_table_excerpt(self, input: Option<TableExcerpt>) -> Self
An excerpt from a table within a document.
Sourcepub fn get_table_excerpt(&self) -> &Option<TableExcerpt>
pub fn get_table_excerpt(&self) -> &Option<TableExcerpt>
An excerpt from a table within a document.
Sourcepub fn collapsed_result_detail(self, input: CollapsedResultDetail) -> Self
pub fn collapsed_result_detail(self, input: CollapsedResultDetail) -> Self
Provides details about a collapsed group of search results.
Sourcepub fn set_collapsed_result_detail(
self,
input: Option<CollapsedResultDetail>,
) -> Self
pub fn set_collapsed_result_detail( self, input: Option<CollapsedResultDetail>, ) -> Self
Provides details about a collapsed group of search results.
Sourcepub fn get_collapsed_result_detail(&self) -> &Option<CollapsedResultDetail>
pub fn get_collapsed_result_detail(&self) -> &Option<CollapsedResultDetail>
Provides details about a collapsed group of search results.
Sourcepub fn build(self) -> QueryResultItem
pub fn build(self) -> QueryResultItem
Consumes the builder and constructs a QueryResultItem
.
Trait Implementations§
Source§impl Clone for QueryResultItemBuilder
impl Clone for QueryResultItemBuilder
Source§fn clone(&self) -> QueryResultItemBuilder
fn clone(&self) -> QueryResultItemBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for QueryResultItemBuilder
impl Debug for QueryResultItemBuilder
Source§impl Default for QueryResultItemBuilder
impl Default for QueryResultItemBuilder
Source§fn default() -> QueryResultItemBuilder
fn default() -> QueryResultItemBuilder
Source§impl PartialEq for QueryResultItemBuilder
impl PartialEq for QueryResultItemBuilder
impl StructuralPartialEq for QueryResultItemBuilder
Auto Trait Implementations§
impl Freeze for QueryResultItemBuilder
impl RefUnwindSafe for QueryResultItemBuilder
impl Send for QueryResultItemBuilder
impl Sync for QueryResultItemBuilder
impl Unpin for QueryResultItemBuilder
impl UnwindSafe for QueryResultItemBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);