Skip to main content

write_source_bundle_descriptor_file

Function write_source_bundle_descriptor_file 

Source
pub fn write_source_bundle_descriptor_file(
    descriptor: &SourceBundleDescriptor,
    output: &Utf8Path,
    limits: SourceArchiveLimits,
) -> Result<(), SourceError>
Expand description

Validate and atomically publish a source-bundle descriptor as canonical JSON.

The output is pretty JSON followed by one newline. Publication is create-only: an existing output is never replaced. The temporary file, destination parent, and published link are bound to captured filesystem identities so cleanup cannot remove an attacker-substituted path.

ยงErrors

Returns an error for an invalid descriptor, an existing output, descriptor size overflow, unsafe destination changes, or filesystem failures. Any file created by this operation is removed on failure when it still has the operation-owned identity.