automerge/rust/automerge/src/storage.rs
Alex Good 0f90fe4d02 Add a method for loading a document without verifying heads
This is primarily useful when debugging documents which have been
corrupted somehow so you would like to see the ops even if you can't
trust them. Note that this is _not_ currently useful for performance
reasons as the hash graph is still constructed, just not verified.
2022-12-19 16:30:14 +00:00

24 lines
670 B
Rust

use std::ops::Range;
pub(crate) mod change;
mod chunk;
mod columns;
pub(crate) mod convert;
mod document;
pub(crate) mod load;
pub(crate) mod parse;
pub(crate) mod save;
pub(crate) use {
change::{AsChangeOp, Change, ChangeOp, Compressed, ReadChangeOpError},
chunk::{CheckSum, Chunk, ChunkType, Header},
columns::{Columns, MismatchingColumn, RawColumn, RawColumns},
document::{AsChangeMeta, AsDocOp, ChangeMetadata, CompressConfig, DocOp, Document},
load::VerificationMode,
};
fn shift_range(range: Range<usize>, by: usize) -> Range<usize> {
range.start + by..range.end + by
}
pub(crate) const MAGIC_BYTES: [u8; 4] = [0x85, 0x6f, 0x4a, 0x83];