pub struct DiscoveredUrl {
pub url: String,
pub text: String,
pub description: String,
pub relevance: f32,
pub recommended: bool,
pub category: String,
}Expand description
A discovered URL with AI-generated metadata.
Fields§
§url: StringThe URL.
text: StringLink text or title.
description: StringAI-generated description of what this URL likely contains.
relevance: f32Relevance to the prompt (0.0 - 1.0).
recommended: boolWhether this URL is recommended to visit.
category: StringCategory of the URL (navigation, content, external, etc.).
Implementations§
Source§impl DiscoveredUrl
impl DiscoveredUrl
Sourcepub fn new(url: impl Into<String>) -> DiscoveredUrl
pub fn new(url: impl Into<String>) -> DiscoveredUrl
Create a new discovered URL.
Sourcepub fn with_details(
url: impl Into<String>,
text: impl Into<String>,
description: impl Into<String>,
relevance: f32,
category: impl Into<String>,
) -> DiscoveredUrl
pub fn with_details( url: impl Into<String>, text: impl Into<String>, description: impl Into<String>, relevance: f32, category: impl Into<String>, ) -> DiscoveredUrl
Create with full details.
Sourcepub fn with_text(self, text: impl Into<String>) -> DiscoveredUrl
pub fn with_text(self, text: impl Into<String>) -> DiscoveredUrl
Set the text.
Sourcepub fn with_description(self, description: impl Into<String>) -> DiscoveredUrl
pub fn with_description(self, description: impl Into<String>) -> DiscoveredUrl
Set the description.
Sourcepub fn with_relevance(self, relevance: f32) -> DiscoveredUrl
pub fn with_relevance(self, relevance: f32) -> DiscoveredUrl
Set the relevance.
Sourcepub fn with_recommended(self, recommended: bool) -> DiscoveredUrl
pub fn with_recommended(self, recommended: bool) -> DiscoveredUrl
Set whether recommended.
Sourcepub fn with_category(self, category: impl Into<String>) -> DiscoveredUrl
pub fn with_category(self, category: impl Into<String>) -> DiscoveredUrl
Set the category.
Check if this is a navigation URL.
Sourcepub fn is_content(&self) -> bool
pub fn is_content(&self) -> bool
Check if this is a content URL.
Sourcepub fn is_external(&self) -> bool
pub fn is_external(&self) -> bool
Check if this is an external URL.
Trait Implementations§
Source§impl Clone for DiscoveredUrl
impl Clone for DiscoveredUrl
Source§fn clone(&self) -> DiscoveredUrl
fn clone(&self) -> DiscoveredUrl
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 DiscoveredUrl
impl Debug for DiscoveredUrl
Source§impl Default for DiscoveredUrl
impl Default for DiscoveredUrl
Source§fn default() -> DiscoveredUrl
fn default() -> DiscoveredUrl
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DiscoveredUrl
impl<'de> Deserialize<'de> for DiscoveredUrl
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DiscoveredUrl, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DiscoveredUrl, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for DiscoveredUrl
impl Serialize for DiscoveredUrl
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for DiscoveredUrl
impl RefUnwindSafe for DiscoveredUrl
impl Send for DiscoveredUrl
impl Sync for DiscoveredUrl
impl Unpin for DiscoveredUrl
impl UnsafeUnpin for DiscoveredUrl
impl UnwindSafe for DiscoveredUrl
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