reproto_core/rp_code.rs
1//! Literal code segments
2
3use Loc;
4
5#[derive(Debug, Clone, Serialize)]
6#[serde(tag = "type", rename_all = "snake_case")]
7pub enum RpContext {
8 Csharp {},
9 Go {},
10 Java {
11 /// Imports to perform for the given code block.
12 /// These will be de-duplicated by the java backend.
13 imports: Vec<Loc<String>>,
14 },
15 Js {},
16 Json {},
17 Python {},
18 Reproto {},
19 Rust {},
20 Swift {},
21}
22
23#[derive(Debug, Clone, Serialize)]
24pub struct RpCode {
25 pub context: RpContext,
26 pub lines: Vec<String>,
27}