Skip to main content

comindly_api/
view.rs

1use std::borrow::Cow;
2
3use serde::{Deserialize, Serialize};
4
5use crate::conventions::{Convention, Manual};
6use crate::ledger::Entry;
7use crate::manifests::InternalDep;
8use crate::model::{Edge, Symbol};
9
10/// The parts of an index a server sends a client; the client rebuilds the rest.
11#[derive(Serialize, Deserialize)]
12pub struct View<'a> {
13    pub symbols: Cow<'a, [Symbol]>,
14    pub edges: Cow<'a, [Edge]>,
15    /// Ledger entries with the status and trust the server derived.
16    pub entries: Cow<'a, [Entry]>,
17    pub conventions: Cow<'a, [Convention]>,
18    pub manual: Cow<'a, [Manual]>,
19    pub deps: Cow<'a, [InternalDep]>,
20    pub problem: Option<String>,
21}