Expand description
Frequently used types and traits.
This module contains the most common types and traits to import. Here is an idiomatic way to import the prelude:
use starina_api::prelude::*;
let mut v = Vec::new();
v.push(1);
§What’s in the prelude?
Since Starina apps are #![no_std]
crates, this prelude includes types from
alloc
so that experienced
Rust programmers can use familiar types without asking “Where is Vec
?”.
§Why should I use the prelude?
You don’t have to use the prelude. However, it’s a convenient way to reduce the number of your keystrokes.
Modules§
- A contiguous growable array type with heap-allocated contents, written
Vec<T>
.
Macros§
- Logs with
LogLevel::Debug
. - Similar to
warn!
, but only logs in debug mode. - Logs with
LogLevel::Error
. - Creates a
String
using interpolation of runtime expressions. - Logs with
LogLevel::Info
. - Logs with
LogLevel::Trace
. - Creates a
Vec
containing the arguments. - Logs with
LogLevel::Warn
.
Structs§
- A pointer type that uniquely owns a heap allocation of type
T
. - A UTF-8–encoded, growable string.
- A contiguous growable array type, written as
Vec<T>
, short for ‘vector’.
Traits§
- A generalization of
Clone
to borrowed data. - A trait for converting a value to a
String
.