pub struct CHKSerializer {
pub format_num: Vec<u8>,
pub maximum_size: usize,
pub search_key_name: Vec<u8>,
}Expand description
CHK-based inventory serializer. Same wire format as v8/v10 etc., but parameterised over format number, max page size and search-key name because CHK inventories live behind a content-addressable store and these settings select which on-disk layout is in use.
The plain (non-CHK) flat serializers above implement the “altered-by” hack — line-by-line regex scanning to discover per-text revisions. CHK inventories are stored differently (one CHK node per entry rather than one XML line) so that hack does not apply.
Fields§
§format_num: Vec<u8>§maximum_size: usize§search_key_name: Vec<u8>Implementations§
Trait Implementations§
Source§impl InventorySerializer for CHKSerializer
impl InventorySerializer for CHKSerializer
fn format_num(&self) -> &[u8] ⓘ
Source§fn support_altered_by_hack(&self) -> bool
fn support_altered_by_hack(&self) -> bool
Whether this serializer supports the “altered-by” hack — extracting
per-text revision references by regex-scanning inventory lines
without parsing the full XML. True for the flat XML formats
(v5/v6/v7/v8); false for v4 and CHK serializers.
Source§fn write_inventory_to_lines(
&self,
inv: &MutableInventory,
working: bool,
) -> Result<Vec<Vec<u8>>, Error>
fn write_inventory_to_lines( &self, inv: &MutableInventory, working: bool, ) -> Result<Vec<Vec<u8>>, Error>
Serialize the inventory to a vector of byte chunks (one per line). Read more
Source§fn read_inventory_from_lines(
&self,
lines: &[&[u8]],
revision_id: Option<RevisionId>,
) -> Result<MutableInventory, Error>
fn read_inventory_from_lines( &self, lines: &[&[u8]], revision_id: Option<RevisionId>, ) -> Result<MutableInventory, Error>
Read an inventory from a sequence of byte-chunks (lines).
Source§fn write_inventory_to_chunks(
&self,
inv: &MutableInventory,
working: bool,
) -> Result<Vec<Vec<u8>>, Error>
fn write_inventory_to_chunks( &self, inv: &MutableInventory, working: bool, ) -> Result<Vec<Vec<u8>>, Error>
Serialize the inventory to a vector of byte chunks (alias for lines).
Source§fn write_inventory_to_string(
&self,
inv: &MutableInventory,
working: bool,
) -> Result<Vec<u8>, Error>
fn write_inventory_to_string( &self, inv: &MutableInventory, working: bool, ) -> Result<Vec<u8>, Error>
Serialize the inventory to a single byte string.
Source§fn write_inventory(
&self,
inv: &MutableInventory,
f: &mut dyn Write,
working: bool,
) -> Result<Vec<Vec<u8>>, Error>
fn write_inventory( &self, inv: &MutableInventory, f: &mut dyn Write, working: bool, ) -> Result<Vec<Vec<u8>>, Error>
Write the inventory directly to a writer.
Source§fn read_inventory(
&self,
f: &mut dyn Read,
revision_id: Option<RevisionId>,
) -> Result<MutableInventory, Error>
fn read_inventory( &self, f: &mut dyn Read, revision_id: Option<RevisionId>, ) -> Result<MutableInventory, Error>
Read an inventory from a reader.
Auto Trait Implementations§
impl Freeze for CHKSerializer
impl RefUnwindSafe for CHKSerializer
impl Send for CHKSerializer
impl Sync for CHKSerializer
impl Unpin for CHKSerializer
impl UnsafeUnpin for CHKSerializer
impl UnwindSafe for CHKSerializer
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
Mutably borrows from an owned value. Read more