Rust Static


Example

The static keyword declares a global static binding, which may be mutable.

static HELLO_WORLD: &'static str = "Hello, world!";

fn main() {
    println("{}", HELLO_WORLD);
}

This outputs

Hello, world!