pub struct TextSearchResult {
pub source_name: Option<String>,
pub source_link: Option<String>,
pub text: String,
pub raw_representation: Option<Value>,
}Expand description
One search hit.
Fields§
§source_name: Option<String>The source document’s name, if known.
source_link: Option<String>A link to the source document, if known.
text: StringThe text to give the model.
raw_representation: Option<Value>The search backend’s own value for this hit, for a custom formatter.
Implementations§
Source§impl TextSearchResult
impl TextSearchResult
Sourcepub fn new(text: impl Into<String>) -> TextSearchResult
pub fn new(text: impl Into<String>) -> TextSearchResult
A result carrying text and nothing else.
Sourcepub fn with_source(
self,
name: impl Into<String>,
link: impl Into<String>,
) -> TextSearchResult
pub fn with_source( self, name: impl Into<String>, link: impl Into<String>, ) -> TextSearchResult
This result with a source name and link.
Trait Implementations§
Source§impl Clone for TextSearchResult
impl Clone for TextSearchResult
Source§fn clone(&self) -> TextSearchResult
fn clone(&self) -> TextSearchResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TextSearchResult
impl Debug for TextSearchResult
Source§impl Default for TextSearchResult
impl Default for TextSearchResult
Source§fn default() -> TextSearchResult
fn default() -> TextSearchResult
Returns the “default value” for a type. Read more
Source§impl PartialEq for TextSearchResult
impl PartialEq for TextSearchResult
impl StructuralPartialEq for TextSearchResult
Auto Trait Implementations§
impl Freeze for TextSearchResult
impl RefUnwindSafe for TextSearchResult
impl Send for TextSearchResult
impl Sync for TextSearchResult
impl Unpin for TextSearchResult
impl UnsafeUnpin for TextSearchResult
impl UnwindSafe for TextSearchResult
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