base/
index.rs

1//! Foundation runtime library for Trident 3
2#![crate_name = "base"]
3#![allow(nonstandard_style)]
4#![warn(missing_docs, missing_abi)]
5#![feature(decl_macro, coerce_unsized, unsize)]
6#![no_std]
7
8// MODULES //
9
10/// TODO: document `alloc` module.
11#[cfg(feature = "allocators")]
12pub mod alloc;
13
14/// TODO: document `array` module.
15#[cfg(feature = "allocators")]
16pub mod array;
17
18/// TODO: document `error` module.
19pub mod error;
20
21/// TODO: document `external` module.
22pub mod externs;
23
24/// TODO: document `io` module.
25pub mod io;
26
27/// TODO: document `math` module.
28pub mod math;
29
30/// TODO: document `memory` module.
31pub mod memory;
32
33/// Implements an FFI-safe [`Optional`][crate::optional::Optional] type, equivalent to
34/// [`Option`][core::option::Option] in Standard Rust.
35pub mod optional;
36
37/// Various smart pointer implementations.
38///
39/// [`Unique`][crate::pointer::unique::Unique] is similar to `std::unique_ptr` in C++,
40/// whereas [`Shared`][crate::pointer::shared::Shared] is similar to `std::shared_ptr` in C++ or
41/// [`Arc`][alloc::sync::Arc].
42pub mod pointer;
43
44/// System process tracking.
45pub mod process;
46
47/// [`String`][crate::string::String]: A growable UTF-8 string.
48#[cfg(feature = "allocators")]
49pub mod string;
50
51/// Facilities for handling low-level system calls.
52pub mod syscall;
53
54/// Coroutine handling facilities, i.e. `async`/`.await` and task runners.
55pub mod tasks;
56
57/// Facilities for interacting with standard input/output.
58pub mod terminal;
59
60/// A pair of UART (universal asynchronous receiver-transmitter) implementations, one memory-mapped,
61/// and the other mapped to serial hardware.
62///
63/// [`SerialPort`][crate::uart::SerialPort]: Serial hardware-mapped UART, useful alongside pixel-buffers
64/// for printing visual output.
65///
66/// [`MmioPort`][crate::uart::MmioPort]: A virtual, memory-mapped UART useful for the reasons above
67/// on hardware that does not support physical UART hardware.
68pub mod uart;
69
70// IMPORTS //
71
72extern crate alloc as std_alloc;
73extern crate bitflags;
74extern crate cfg_if;
75extern crate conquer_once;
76extern crate core;
77extern crate crossbeam_queue;
78extern crate lazy_static;
79extern crate noto_sans_mono_bitmap;
80extern crate rustversion;
81extern crate spin;
82extern crate spinning_top;
83extern crate springboard_api;
84#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
85extern crate x86;
86#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
87extern crate x86_64;
88
89// EXPORTS //
90
91/// Export the [`log`](https://docs.rs/log/latest/log) crate to enable consistent logging without additional dependencies.
92pub extern crate log;