Cargo Features

[dependencies]
gstd = { version = "1.4.1", default-features = false, features = ["panic-handler", "panic-message", "panic-location", "nightly", "panic-info-message", "oom-handler", "debug", "document-features"] }
default = panic-message

## Default features

panic-handler panic-message = const_format

Panic handler profiles

We currently use the following format for panic messages from Rust code: panicked with '{message}'[ at '{location}']. Also Panic occurred: will be added to the beginning of the panic message by our core-backend.

So the final panic message looks like this: Panic occurred: panicked with '{message}'[ at '{location}'].

You can configure which panic handler profile you need by specifying one of the following functions:

When enabled, a minimal panic handler is provided by this crate. Instead of a panic message, <unknown> is displayed.

panic-message default panic-location? = arrayvec, panic-handler

When enabled, a panic handler will also display a panic message.

panic-location = panic-message

When enabled, a panic handler will also display a panic message and location.
This function is not recommended for use in production environment because it displays the code path.

nightly = oom-handler, panic-info-message

Nightly features

The panic-message and panic-location features gets additional optimizations when using the nightly compiler.

For example, if you don't use the panic-location feature, the compiler will remove all locations such as /home/username/dapp/src/lib.rs:1:2 from the binary. The size of program will be reduced and /home/username/... information will not be included in the binary.

Enables all features below. These features depend on unstable Rust API and require nightly toolchain.

panic-info-message nightly?

When enabled, a panic handler will use a more efficient implementation. Relies on [panic_info_message][rust-66745].

oom-handler nightly?

When enabled, an OOM error handler is provided. Relies on [alloc_error_handler][rust-51540],

Affects handlers::oom

debug

## Additional features

Enables debug logging; this heavily impacts gas cost and is therefore disabled by default.

Enables debug of galloc and gcore

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

arrayvec panic-message
const_format panic-handler?
document-features implicit feature

Enables document-features

document-features:

Extract documentation for the feature flags from comments in Cargo.toml