Public declaration syntax from forge-rs/crates/forge-embed/src/document.rs Original source SHA-256: 8d95d8e9d6be575f5d12050c9c17c1c9a27e67c436bd5fff569099e9a0c4aa3e Function bodies and constant values are omitted. This is not the complete implementation. Source line 38 #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Document { /// The text content of the document. pub content: String, /// Arbitrary metadata associated with this document. pub metadata: serde_json::Value } Source line 61 pub fn new(content: impl Into) -> Self; Source line 84 pub fn with_metadata(content: impl Into, metadata: serde_json::Value) -> Self; Source line 92 pub fn is_empty(&self) -> bool; Source line 97 pub fn len(&self) -> usize; Source line 125 pub trait DocumentLoader: Send + Sync { /// Loads documents from the given source string. /// /// # Arguments /// /// * `source` - The source to load from. Interpretation depends on the /// implementation (raw text, JSON string, file path, etc.). /// /// # Returns /// /// A vector of loaded documents. /// /// # Errors /// /// Returns [`ForgeEmbedError`] if loading fails (e.g., invalid format, /// empty input). fn load(&self, source: &str) -> EmbedResult>; } Source line 160 #[derive(Debug, Clone, Copy, Default)] pub struct TextLoader; Source line 204 #[derive(Debug, Clone, Default)] pub struct JsonLoader { } Source line 228 pub fn new(content_field: Option) -> Self;