pub struct BaseTree {
pub dir: String,
pub render_sha256: String,
pub files: BTreeMap<RelPath, String>,
}Expand description
A previous render (a deploy render --out directory), re-hashed from its
real bytes (--base, 22-04).
render.json is read for identity (gateway, env, mode) and as a
consistency check only: its file list, every per-file sha256 and its
render_sha256 must agree with what BaseTree::read recomputes from the
directory, so a crash-unsafe refresh (21-SECURITY R-03 / WR-03), a leftover
.ign-render-tmp file, or any hand edit is refused instead of being
trusted. File bytes are hashed while streaming and never kept.
Fields§
§dir: StringThe directory as given.
render_sha256: StringThe recomputed render_sha256 (equals the marker’s).
files: BTreeMap<RelPath, String>Recomputed sha256 per collection path (render.json excluded).
Implementations§
Source§impl BaseTree
impl BaseTree
Sourcepub fn read(
dir: &Path,
gateway: &str,
env: &str,
mode: &str,
) -> Result<BaseTree, CoreError>
pub fn read( dir: &Path, gateway: &str, env: &str, mode: &str, ) -> Result<BaseTree, CoreError>
Read and verify dir as a clean render of gateway, env, mode.
dir must be a real directory (not a symlink). It is walked with
symlink_metadata, capped at READ_MAX_ENTRIES; a symlink, special
file or non-UTF-8 name anywhere under it is refused. render.json
must parse as a schema 1 RenderMarker of the same gateway,
environment and mode; the walked files must be exactly the marker’s
files; every recomputed sha256, size and the recomputed listing digest
must equal the marker’s. Every refusal is invalid_input naming the
directory, the problem and the first differing path; none echoes file
content.
Trait Implementations§
impl Eq for BaseTree
impl StructuralPartialEq for BaseTree
Auto Trait Implementations§
impl Freeze for BaseTree
impl RefUnwindSafe for BaseTree
impl Send for BaseTree
impl Sync for BaseTree
impl Unpin for BaseTree
impl UnsafeUnpin for BaseTree
impl UnwindSafe for BaseTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.