#[non_exhaustive]pub struct DocumentMetadata {
pub document: String,
pub uri: String,
pub title: String,
pub page_identifier: String,
pub struct_data: Option<Struct>,
/* private fields */
}Available on crate features
conversational-search-service or session-service only.Expand description
Document metadata.
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.document: StringDocument resource name.
uri: StringURI for the document.
title: StringTitle.
page_identifier: StringPage identifier.
struct_data: Option<Struct>The structured JSON metadata for the document. It is populated from the struct data from the Chunk in search result.
Implementations§
Source§impl DocumentMetadata
impl DocumentMetadata
pub fn new() -> Self
Sourcepub fn set_document<T: Into<String>>(self, v: T) -> Self
pub fn set_document<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_page_identifier<T: Into<String>>(self, v: T) -> Self
pub fn set_page_identifier<T: Into<String>>(self, v: T) -> Self
Sets the value of page_identifier.
§Example
ⓘ
let x = DocumentMetadata::new().set_page_identifier("example");Sourcepub fn set_struct_data<T>(self, v: T) -> Self
pub fn set_struct_data<T>(self, v: T) -> Self
Sets the value of struct_data.
§Example
ⓘ
use wkt::Struct;
let x = DocumentMetadata::new().set_struct_data(Struct::default()/* use setters */);Sourcepub fn set_or_clear_struct_data<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_struct_data<T>(self, v: Option<T>) -> Self
Sets or clears the value of struct_data.
§Example
ⓘ
use wkt::Struct;
let x = DocumentMetadata::new().set_or_clear_struct_data(Some(Struct::default()/* use setters */));
let x = DocumentMetadata::new().set_or_clear_struct_data(None::<Struct>);Trait Implementations§
Source§impl Clone for DocumentMetadata
impl Clone for DocumentMetadata
Source§fn clone(&self) -> DocumentMetadata
fn clone(&self) -> DocumentMetadata
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 DocumentMetadata
impl Debug for DocumentMetadata
Source§impl Default for DocumentMetadata
impl Default for DocumentMetadata
Source§fn default() -> DocumentMetadata
fn default() -> DocumentMetadata
Returns the “default value” for a type. Read more
Source§impl Message for DocumentMetadata
impl Message for DocumentMetadata
Source§impl PartialEq for DocumentMetadata
impl PartialEq for DocumentMetadata
impl StructuralPartialEq for DocumentMetadata
Auto Trait Implementations§
impl Freeze for DocumentMetadata
impl RefUnwindSafe for DocumentMetadata
impl Send for DocumentMetadata
impl Sync for DocumentMetadata
impl Unpin for DocumentMetadata
impl UnwindSafe for DocumentMetadata
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