1use gpui::SharedString;
2use serde::{Deserialize, Serialize};
3use util::post_inc;
4
5#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Serialize, Deserialize)]
6pub struct ContextId(pub(crate) usize);
7
8impl ContextId {
9 pub fn post_inc(&mut self) -> Self {
10 Self(post_inc(&mut self.0))
11 }
12}
13
14/// Some context attached to a message in a thread.
15#[derive(Debug, Clone)]
16pub struct Context {
17 pub id: ContextId,
18 pub name: SharedString,
19 pub kind: ContextKind,
20 pub text: SharedString,
21}
22
23#[derive(Debug, Clone, PartialEq, Eq, Hash)]
24pub enum ContextKind {
25 File,
26 FetchedUrl,
27}