silk.build.write_files.

Generated files whose contents are known values or other steps' deferred values.

Import as WriteFiles with import silk.build.write_files { WriteFiles }.

Public declarations: 2.

WriteFiles#

silk
pub union WriteFiles

A generated-file step shared by static package plans and runtime task graphs.

Static#

silk
Static

Dynamic#

silk
Dynamic

Implementation WriteFiles#

silk
impl WriteFiles

Associated function empty#

silk
pub static fn empty() -> Self

Begins a pure description of generated text files.

Method literal#

silk
pub static fn literal(self: Self, name: string<'static>, content: string<'static>) -> Self

Adds a known text file to a static description.

Method description#

silk
pub static fn description(self: &Self) -> Option<&'static Chain<StaticFile>>

Reads a pure file description; runtime values cannot enter a package plan.

Method result#

silk
pub static fn result(self: &Self, name: string<'static>) -> Deferred<Path>

Names a file without registering or executing its producer.

Associated function make#

silk
pub fn make() -> Self

Starts a generated-file step that accepts runtime values.

Method text#

silk
pub effect fn text(self: Self, name: string, content: string) -> Self ! StepFailure ? &mut Allocator

Adds known UTF-8 text to the generated files.

Method value#

silk
pub effect fn value(self: Self, name: string, content: Deferred<String>) -> Self ! StepFailure ? &mut Allocator

Adds a deferred text value, retaining its producer dependency.

Method register#

silk
pub effect fn register(self: Self) -> StepHandle ! StepFailure ? &mut Allocator

Registers the files and returns a handle to their deferred output paths.

Method registerHere#

silk
pub effect fn registerHere(self: Self) -> StepHandle ! StepFailure ? &mut Allocator

Registers the files as work this process runs itself, without describing it to the compiler.

restore#

silk
pub effect fn restore(step: &[u8]) -> StepHandle ! StepFailure ? &mut Allocator

Restores described files as a step this process can run.

Implementation Step for WriteFiles#

silk
impl Step for WriteFiles

Operation prepare#

silk
effect fn prepare(self: Self) -> Self ! StepFailure ? &mut Allocator

Operation key#

silk
effect fn key(self: &Self, key: &mut Key) -> () ! StepFailure ? &mut Allocator

Operation make#

silk
effect fn make(self: &Self, make: &mut Make) -> () ! StepFailure ? &mut Allocator

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page