ecluse:ecluse-core
Safe HaskellNone
LanguageGHC2021

Ecluse.Core.Mirror.State.Codec

Description

Bounded durable records recheck stored source fragments rather than reconstructing policy facts.

Synopsis

Documentation

encodeProjectRecord :: MirrorStateFormat -> Limits -> ProjectMirrorRecord -> Either MirrorStateFault ByteString Source #

Account for declared companion bytes as well as encoded source records before writing. Another format's source refuses the write.

projectRecordWeight :: MirrorStateFormat -> Limits -> ProjectMirrorRecord -> Either MirrorStateFault Int Source #

Charge the durable graph separately from active-work reservations.

projectRecordWorkWeight :: Limits -> ProjectMirrorRecord -> Either MirrorStateFault Int Source #

Preserve the conservative selected-release allowance for update, worker and encoding overlap.

chargedDecodeProjectRecord :: MirrorStateFormat -> StateCharge -> Limits -> StateTarget -> PackageName -> ByteString -> IO (Either MirrorStateFault ProjectMirrorRecord) Source #

Materialise source fields and domain weights under the reservation. Callers keep it until they release the returned record.

chargedEncodeProjectRecord :: MirrorStateFormat -> StateCharge -> Limits -> ProjectMirrorRecord -> IO (Either MirrorStateFault ByteString) Source #

Reserve retained input, encoded output and validation overlap before creating the encoding tree.

stateExchangeCharge :: Int Source #

Fixed per-exchange metadata bookkeeping, independent of the configured maximum object size.

mirrorInventoryWeight :: MirrorInventory -> Int Source #

The admitted input already belongs to the caller. This estimates state-update scratch from its shape.

Stored source entries

sourceEntries :: [(EntryKey, Value)] -> [Value] Source #

Stored entries keep each value under its source coordinate.

parseSourceEntries :: String -> Object -> Parser [(EntryKey, Value)] Source #

Read stored entries under label, refusing a repeated coordinate.

sourceEntriesCharge :: Value -> Integer Source #

Charge each stored entry's filename at the retained text allowance.

forceSourceEntries :: [(EntryKey, Value)] -> () Source #

Materialise stored entries and their source coordinates.