Skip to main content

format

Function format 

Source
pub fn format(
    source: impl Source,
    size_bytes: u64,
    options: FormatOptions,
) -> Result<Image, FormatError>
Expand description

Format a filesystem of size_bytes populated from source, assembling the whole image in memory.

The image is held as one buffer of its full size, so this needs as much memory as the filesystem is large. format_to writes the same bytes to a seekable destination without ever holding them all.

ยงErrors

A FormatError if the geometry, model, allocation, or serialization cannot be realized, or FormatError::ImageTooLargeInMemory if the image is larger than this platform addresses.