entrenar/research/notebook/
kernel.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
7pub struct KernelSpec {
8 pub display_name: String,
10 pub language: String,
12 pub name: String,
14}
15
16impl Default for KernelSpec {
17 fn default() -> Self {
18 Self::python3()
19 }
20}
21
22impl KernelSpec {
23 pub fn python3() -> Self {
25 Self {
26 display_name: "Python 3".to_string(),
27 language: "python".to_string(),
28 name: "python3".to_string(),
29 }
30 }
31
32 pub fn evcxr() -> Self {
34 Self {
35 display_name: "Rust".to_string(),
36 language: "rust".to_string(),
37 name: "rust".to_string(),
38 }
39 }
40
41 pub fn julia() -> Self {
43 Self {
44 display_name: "Julia 1.9".to_string(),
45 language: "julia".to_string(),
46 name: "julia-1.9".to_string(),
47 }
48 }
49}