-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathstd_extensions.rs
More file actions
38 lines (34 loc) · 1.25 KB
/
std_extensions.rs
File metadata and controls
38 lines (34 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Experiments for `Extension` definitions.
//!
//! These may be moved to other crates in the future, or dropped altogether.
use crate::extension::ExtensionRegistry;
pub mod arithmetic;
pub mod collections;
pub mod logic;
pub mod ptr;
/// Extension registry with all standard extensions and prelude.
#[must_use]
pub fn std_reg() -> ExtensionRegistry {
let reg = ExtensionRegistry::new([
crate::extension::prelude::PRELUDE.clone(),
arithmetic::int_ops::EXTENSION.to_owned(),
arithmetic::int_types::EXTENSION.to_owned(),
arithmetic::conversions::EXTENSION.to_owned(),
arithmetic::float_ops::EXTENSION.to_owned(),
arithmetic::float_types::EXTENSION.to_owned(),
collections::array::EXTENSION.to_owned(),
collections::list::EXTENSION.to_owned(),
collections::borrow_array::EXTENSION.to_owned(),
collections::static_array::EXTENSION.to_owned(),
collections::value_array::EXTENSION.to_owned(),
logic::EXTENSION.to_owned(),
ptr::EXTENSION.to_owned(),
]);
reg.validate()
.expect("Standard extension registry is valid");
reg
}
lazy_static::lazy_static! {
/// Standard extension registry.
pub static ref STD_REG: ExtensionRegistry = std_reg();
}