wire/answer/preview.rs
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4// Copyright (c) 2026 2youg1 and the sprawling contributors
5
6//! One window of a stored Markdown version, laid out as blocks
7//! (`crates/wire/spec/Answer/Preview.lean` ยง8-74).
8//!
9//! Read by the version, for the reason a range is: a page previewing a
10//! file a resident is rewriting goes on reading the version it opened.
11//! The blocks are the `documents` crate's grammar, carried as it spells
12//! them (`crates/documents/Spec.lean` D1, D21); `Laid.span` says which
13//! stretch was read, which is where the next request starts from.
14
15use documents::Preview;
16use kernel::B3Hash;
17use serde::{Deserialize, Serialize};
18
19#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
20#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
21pub struct PreviewAnswer {
22 pub version: B3Hash,
23 pub preview: Preview,
24}