hanzo_client/models/source.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Source {
16 /// Engine is the search backend the hit came from: bing, ddg, mojeek or brave. Omitted when the backend did not name itself. Results are merged across backends, so two sources in one answer can carry different engines.
17 #[serde(rename = "engine", skip_serializing_if = "Option::is_none")]
18 pub engine: Option<String>,
19 /// Favicon is a 64px icon URL derived from the host for the client to render beside the citation. It is Google's s2 service, not something we host or fetched — an empty host yields the empty string.
20 #[serde(rename = "favicon", skip_serializing_if = "Option::is_none")]
21 pub favicon: Option<String>,
22 /// Snippet is the engine's summary of the page, clipped to 600 runes. THIS IS WHAT THE CLIENT SHOWS. What the model reads is the fetched page, which is far larger and deliberately never on the wire.
23 #[serde(rename = "snippet", skip_serializing_if = "Option::is_none")]
24 pub snippet: Option<String>,
25 /// Title is the page title the engine reported, stripped of the bracketed furniture engines staple on (\"[PDF]\", \"(Official Site)\"). It falls back to the www-stripped host when the engine gave none, so it is never empty and is safe to use as link text.
26 #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
27 pub title: Option<String>,
28 /// URL is the page, absolute, exactly as the engine gave it. It is also the dedupe key — one source per URL, and at most hostCap per host — and what a markdown citation in the answer is checked against, so a link in the prose always matches a URL here.
29 #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
30 pub url: Option<String>,
31}
32
33impl Source {
34 pub fn new() -> Source {
35 Source {
36 engine: None,
37 favicon: None,
38 snippet: None,
39 title: None,
40 url: None,
41 }
42 }
43}
44