Home / Docs / Configure a package

[package] version

Release v0.4.0Edition 0.1 and laterU7002

What it does

A package is one program or library: a directory that holds the source files under src/ and a file una.toml, its manifest, which says what the package is called, which version it is and which edition of Una it uses. version is the package's own version, which its authors raise as they release changes. It is required, in the [package] table, and is a non-blank string.

Learn more: The manifest and the lock.

una.tomltoml
[package]
name = "shop"
version = "0.1.0"
edition = "0.2"
src/shop.unauna
module shop

pub price(cents: Int) -> Int = cents

Forms

toml
[package]
version = "<a non-blank string>"

The specification requires a non-empty string and fixes no format beyond that; a string of spaces only is refused too. A package's una.toml is a TOML document (TOML is a plain text format of key = value lines grouped under [table] headers) with the tables and keys the specification defines, and no others. A syntax error, a missing required key, and a value of the wrong type or outside its range are U7002.

Examples

A package without a version is rejected:

una.tomltoml
[package]
name = "shop"
edition = "0.2"
src/shop.unauna
-- fails with U7002
module shop

pub price(cents: Int) -> Int = cents

Edge cases

Further rules:

Diagnostics

Edition

version is the same in editions 0.1 and 0.2. From edition 0.4 it is the head line version of ita.una, and it must have the form MAJOR.MINOR.PATCH: any other is U7008 (see ita.una).

Normative source