Skip to main content

write_bytes

Function write_bytes 

Source
pub fn write_bytes(
    path: &Path,
    options: WriteOptions,
    bytes: &[u8],
) -> Result<(), NamedWriteError<Error>>
Expand description

Durably publish complete bytes with explicit mode and staging permissions.

Missing parent directories are created and durably linked before the file is published. Uses the same engine and caller obligations as write_with. Serialization must complete before calling this helper. options selects replace/create-only publication and permission bits reduced by the umask.

ยงErrors

Retains write, cleanup and filesystem failures in NamedWriteError, including the distinct after-publication state when the complete output is already visible. Create-only mode refuses an occupied destination; invalid permissions refuse before parent creation. Reconcile after-publication errors before retrying.