Skip to main content

systemprompt_models/content/
link.rs

1//! Typed links between content items.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6use schemars::JsonSchema;
7use serde::{Deserialize, Serialize};
8
9#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
10pub struct ContentLink {
11    pub title: String,
12    pub url: String,
13}
14
15impl ContentLink {
16    pub fn new(title: impl Into<String>, url: impl Into<String>) -> Self {
17        Self {
18            title: title.into(),
19            url: url.into(),
20        }
21    }
22}