pub struct GenerativeSummary {
pub overview: LocalizedText,
pub overview_flag_content_uri: Option<Url>,
pub disclosure_text: LocalizedText,
}Expand description
AI-generated summary of a place.
Generative summaries provide AI-created overviews of places based on available data, reviews, and other contextual information.
These summaries help users quickly understand what a place is about, its key features, and what to expect. The summaries include moderation links for content reporting and disclosure information about AI generation.
Fields§
§overview: LocalizedTextThe AI-generated overview of the place.
Contains the main summary content describing the place, its features, atmosphere, and key characteristics. This text is generated by AI and provides a concise overview to help users understand the place.
overview_flag_content_uri: Option<Url>A link where users can flag a problem with the overview summary.
URL that allows users to report inappropriate content, inaccuracies, or other issues with the AI-generated summary. This provides a mechanism for content moderation and quality improvement.
disclosure_text: LocalizedTextThe AI disclosure message indicating the content was AI-generated.
Standard disclosure text such as “Summarized with Gemini” and its localized variants. This text informs users that the content was generated by AI and provides transparency about the source.
Implementations§
Source§impl GenerativeSummary
impl GenerativeSummary
Sourcepub fn overview(&self) -> &LocalizedText
pub fn overview(&self) -> &LocalizedText
The AI-generated overview of the place.
Contains the main summary content describing the place, its features, atmosphere, and key characteristics. This text is generated by AI and provides a concise overview to help users understand the place.
Sourcepub fn overview_flag_content_uri(&self) -> &Option<Url>
pub fn overview_flag_content_uri(&self) -> &Option<Url>
A link where users can flag a problem with the overview summary.
URL that allows users to report inappropriate content, inaccuracies, or other issues with the AI-generated summary. This provides a mechanism for content moderation and quality improvement.
Sourcepub fn disclosure_text(&self) -> &LocalizedText
pub fn disclosure_text(&self) -> &LocalizedText
The AI disclosure message indicating the content was AI-generated.
Standard disclosure text such as “Summarized with Gemini” and its localized variants. This text informs users that the content was generated by AI and provides transparency about the source.
Source§impl GenerativeSummary
impl GenerativeSummary
Sourcepub const fn new(
overview: LocalizedText,
disclosure_text: LocalizedText,
) -> Self
pub const fn new( overview: LocalizedText, disclosure_text: LocalizedText, ) -> Self
Creates a new GenerativeSummary with the specified overview and disclosure.
Used to construct a generative summary with the essential AI-generated content and required disclosure information about AI generation.
Sourcepub fn with_moderation(
overview: LocalizedText,
disclosure_text: LocalizedText,
flag_uri: &str,
) -> Result<Self, Error>
pub fn with_moderation( overview: LocalizedText, disclosure_text: LocalizedText, flag_uri: &str, ) -> Result<Self, Error>
Creates a GenerativeSummary with moderation link included.
Used when content reporting functionality is available, providing users with a way to flag issues with the AI-generated content.
Sourcepub fn has_content(&self) -> bool
pub fn has_content(&self) -> bool
Returns whether this summary has content.
Used to determine if the summary contains meaningful text content that can be displayed to users, checking for non-empty overview text.
Sourcepub const fn has_moderation(&self) -> bool
pub const fn has_moderation(&self) -> bool
Returns whether content moderation is available.
Used to determine if users can report issues with the summary content, enabling appropriate user interface elements for content reporting.
Sourcepub fn overview_text(&self) -> &str
pub fn overview_text(&self) -> &str
Gets the overview text in the summary’s language.
Returns the main summary content text, useful for display in user interfaces and content processing applications.
Sourcepub fn overview_language(&self) -> &Locale
pub fn overview_language(&self) -> &Locale
Gets the language code of the overview content.
Returns the BCP-47 language code for the summary text, useful for internationalization, content filtering, and language-specific processing.
Sourcepub fn disclosure_text_content(&self) -> &str
pub fn disclosure_text_content(&self) -> &str
Gets the disclosure text content.
Returns the AI disclosure message text, typically displayed alongside or after the summary to inform users about AI generation.
Sourcepub fn is_in_language(&self, language_str: &str) -> bool
pub fn is_in_language(&self, language_str: &str) -> bool
Returns whether the summary is in a specific language.
Used for language-based filtering and content organization, helping applications show summaries in users’ preferred languages.
Sourcepub fn estimated_reading_time(&self) -> Duration
pub fn estimated_reading_time(&self) -> Duration
Gets the estimated reading time for the overview.
Calculates approximate reading time based on word count and average reading speed, useful for user interfaces showing content length.
Sourcepub fn character_count(&self) -> usize
pub fn character_count(&self) -> usize
Returns the character count of the overview.
Used for content length validation, user interface layout decisions, and determining appropriate display formatting for the summary.
Sourcepub fn word_count(&self) -> usize
pub fn word_count(&self) -> usize
Returns the word count of the overview.
Used for content analysis, length categorization, and determining appropriate display treatments for summaries of different lengths.
Sourcepub fn is_short_summary(&self) -> bool
pub fn is_short_summary(&self) -> bool
Returns whether this is a short summary.
Used to identify brief summaries that may be suitable for compact displays, preview cards, or mobile interfaces with space constraints.
Sourcepub fn is_detailed_summary(&self) -> bool
pub fn is_detailed_summary(&self) -> bool
Returns whether this is a detailed summary.
Used to identify comprehensive summaries that provide extensive information and may require expanded display areas or detailed views.
Sourcepub fn preview_text(&self, max_chars: usize) -> String
pub fn preview_text(&self, max_chars: usize) -> String
Gets a truncated version of the overview for previews.
Returns a shortened version of the summary suitable for preview cards, search results, or space-constrained interfaces while maintaining readability.
Sourcepub fn to_html(&self) -> String
pub fn to_html(&self) -> String
Creates HTML markup for the summary with proper disclosure.
Generates HTML content that includes both the summary text and disclosure information with appropriate styling and structure.
Sourcepub fn to_markdown(&self) -> String
pub fn to_markdown(&self) -> String
Creates markdown representation of the summary.
Generates markdown-formatted content suitable for documentation, export features, or markdown-based content management systems.
Sourcepub fn appears_high_quality(&self) -> bool
pub fn appears_high_quality(&self) -> bool
Returns whether the summary content appears to be high quality.
Uses heuristics to assess content quality based on length, structure, and basic content analysis, useful for filtering or prioritizing summaries.
Gets content tags based on summary characteristics.
Returns descriptive tags that categorize the summary content, useful for filtering, organization, and content management.
Sourcepub fn content_analysis(&self) -> SummaryAnalysis
pub fn content_analysis(&self) -> SummaryAnalysis
Returns a structured summary of content characteristics.
Provides comprehensive metadata about the summary content suitable for analytics, content management, and quality assessment.
Trait Implementations§
Source§impl Clone for GenerativeSummary
impl Clone for GenerativeSummary
Source§fn clone(&self) -> GenerativeSummary
fn clone(&self) -> GenerativeSummary
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GenerativeSummary
impl Debug for GenerativeSummary
Source§impl<'de> Deserialize<'de> for GenerativeSummary
impl<'de> Deserialize<'de> for GenerativeSummary
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for GenerativeSummary
impl Hash for GenerativeSummary
Source§impl PartialEq for GenerativeSummary
impl PartialEq for GenerativeSummary
Source§impl Serialize for GenerativeSummary
impl Serialize for GenerativeSummary
impl Eq for GenerativeSummary
impl StructuralPartialEq for GenerativeSummary
Auto Trait Implementations§
impl Freeze for GenerativeSummary
impl RefUnwindSafe for GenerativeSummary
impl Send for GenerativeSummary
impl Sync for GenerativeSummary
impl Unpin for GenerativeSummary
impl UnsafeUnpin for GenerativeSummary
impl UnwindSafe for GenerativeSummary
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.