chromadb_rs/
collection.rs1use serde::{Deserialize, Serialize};
2use serde_json::Value;
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct Collection {
6 pub name: String,
7 pub id: String,
8 pub metadata: Option<Value>,
9}
10
11impl Collection {
12 pub fn new(name: String, metadata: Option<Value>) -> Self {
13 Collection {
14 name,
15 id: String::new(),
16 metadata,
17 }
18 }
19
20 pub fn with_id(name: String, id: String, metadata: Option<Value>) -> Self {
21 Collection { name, id, metadata }
22 }
23}