Skip to main content

GenerativeSummary

Struct GenerativeSummary 

Source
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: 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.

§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: 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.

Implementations§

Source§

impl GenerativeSummary

Source

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.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn content_tags(&self) -> Vec<&'static str>

Gets content tags based on summary characteristics.

Returns descriptive tags that categorize the summary content, useful for filtering, organization, and content management.

Source

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

Source§

fn clone(&self) -> GenerativeSummary

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GenerativeSummary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GenerativeSummary

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for GenerativeSummary

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for GenerativeSummary

Source§

fn eq(&self, other: &GenerativeSummary) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for GenerativeSummary

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for GenerativeSummary

Source§

impl StructuralPartialEq for GenerativeSummary

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,