pub struct UnifiedVolumeBuilder { /* private fields */ }Expand description
Incremental builder for large external-sort merges (one SuperBlock at a time).
Implementations§
Source§impl UnifiedVolumeBuilder
impl UnifiedVolumeBuilder
Sourcepub fn with_lex_map(lex: &HashMap<u64, String>) -> Result<Self, LexError>
pub fn with_lex_map(lex: &HashMap<u64, String>) -> Result<Self, LexError>
Builder whose Q42LEX section is encoded from lex
(hash → term string).
Sourcepub fn with_lex_entries(
lex: &HashMap<u64, LexiconEntry>,
) -> Result<Self, LexError>
pub fn with_lex_entries( lex: &HashMap<u64, LexiconEntry>, ) -> Result<Self, LexError>
Create a builder with a lexicon that supports embedded triples (LexiconEntry).
Sourcepub fn add_payload_catalogue_utf8(
&mut self,
payload_key: &str,
mime_type: &str,
language: Option<&str>,
role: &str,
utf8_body: &str,
) -> Result<PayloadCatalogueEntry>
pub fn add_payload_catalogue_utf8( &mut self, payload_key: &str, mime_type: &str, language: Option<&str>, role: &str, utf8_body: &str, ) -> Result<PayloadCatalogueEntry>
Append a UTF-8 prose/descriptor payload (ADR 0014) to this volume’s PCAT section.
Rejects media MIME types (image/*, audio/*, video/*, .p64, .10d).
Sourcepub fn with_payload_catalogue_blobs(
self,
blobs: &[PayloadCatalogueBlob],
) -> Result<Self>
pub fn with_payload_catalogue_blobs( self, blobs: &[PayloadCatalogueBlob], ) -> Result<Self>
Attach a slice of PayloadCatalogueBlob records (metadata + UTF-8 body arena).
Sourcepub fn with_payload_catalogue_entries(
self,
entries: &[PayloadCatalogueEntry],
) -> Result<Self>
pub fn with_payload_catalogue_entries( self, entries: &[PayloadCatalogueEntry], ) -> Result<Self>
Attach metadata-only PayloadCatalogueEntry descriptors.
Sourcepub fn with_empty_lex() -> Self
pub fn with_empty_lex() -> Self
Builder with an empty (but structurally valid) Q42LEX section.
Sourcepub fn with_volume_manifest(self, manifest: &Q42VolumeManifest) -> Result<Self>
pub fn with_volume_manifest(self, manifest: &Q42VolumeManifest) -> Result<Self>
Embed an immutable logical-volume descriptor in this root Q42 file’s front matter. Child segments remain ordinary self-contained Q42 files.
Set the author DID for DAG commit nodes (optional; defaults to 0 = system).
Sourcepub fn with_permissive_commons(self) -> Self
pub fn with_permissive_commons(self) -> Self
Affirm this tiny embedded volume is a Permissive Commons catalog.
Sourcepub fn with_sanctuary(self) -> Self
pub fn with_sanctuary(self) -> Self
Affirm this volume is Sanctuary / Selfhood.
Sourcepub fn push_block(&mut self, seq_id: u64, quins: &[NQuin]) -> Result<()>
pub fn push_block(&mut self, seq_id: u64, quins: &[NQuin]) -> Result<()>
Append one SuperBlock: enforces global object-hash sort order, accumulates block/field ranges, postings and the LZ4’d data blob, and commits the block to the Merkle-DAG (genesis on first block).
Sourcepub fn block_count(&self) -> u64
pub fn block_count(&self) -> u64
SuperBlocks pushed so far.
Sourcepub fn finish(self, path: &Path) -> Result<()>
pub fn finish(self, path: &Path) -> Result<()>
Assemble and write the complete .q42 file to path
(native only — needs filesystem access).
Sourcepub fn finish_to_bytes(self) -> Vec<u8> ⓘ
pub fn finish_to_bytes(self) -> Vec<u8> ⓘ
Serialise the unified v3 .q42 volume to an in-memory byte buffer.
Byte-for-byte the same volume finish writes to disk, but
returned as bytes for callers that embed a .q42 inside another container
— e.g. a crate::bundle .hmc pack — or ship it over the wire without
touching the filesystem. finish is exactly this plus a file write.
Auto Trait Implementations§
impl Freeze for UnifiedVolumeBuilder
impl RefUnwindSafe for UnifiedVolumeBuilder
impl Send for UnifiedVolumeBuilder
impl Sync for UnifiedVolumeBuilder
impl Unpin for UnifiedVolumeBuilder
impl UnsafeUnpin for UnifiedVolumeBuilder
impl UnwindSafe for UnifiedVolumeBuilder
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more