mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-04-03 13:30:44 +02:00
78 lines
3.3 KiB
Rust
78 lines
3.3 KiB
Rust
#![feature(anonymous_lifetime_in_impl_trait)]
|
|
#![feature(associated_type_defaults)]
|
|
#![feature(const_default)]
|
|
#![feature(const_option_ops)]
|
|
#![feature(const_precise_live_drops)]
|
|
#![feature(const_trait_impl)]
|
|
#![feature(impl_trait_in_assoc_type)]
|
|
#![feature(step_trait)]
|
|
#![feature(trait_alias)]
|
|
#![feature(type_alias_impl_trait)]
|
|
#![feature(type_changing_struct_update)]
|
|
pub extern crate atomic_float;
|
|
pub extern crate palette;
|
|
pub extern crate better_panic;
|
|
pub extern crate unicode_width;
|
|
#[cfg(test)] #[macro_use] pub extern crate proptest;
|
|
|
|
pub(crate) use ::{
|
|
atomic_float::AtomicF64,
|
|
std::fmt::{Debug, Display},
|
|
std::ops::{Add, Sub, Mul, Div},
|
|
std::sync::{Arc, RwLock},
|
|
std::sync::atomic::{AtomicBool, AtomicUsize, Ordering::*},
|
|
};
|
|
|
|
#[cfg(feature = "lang")] pub extern crate dizzle as lang;
|
|
#[cfg(feature = "lang")] pub use ::dizzle::{self, Usually, Perhaps, impl_default};
|
|
#[cfg(feature = "lang")] pub mod eval;
|
|
|
|
#[cfg(feature = "time")] pub mod time;
|
|
|
|
#[cfg(feature = "play")] pub mod play;
|
|
#[cfg(feature = "play")] pub mod exit;
|
|
#[cfg(feature = "play")] pub mod task;
|
|
|
|
#[cfg(feature = "sing")] pub extern crate jack;
|
|
#[cfg(feature = "sing")] pub mod sing;
|
|
#[cfg(feature = "sing")] pub use ::jack::{*, contrib::{*, ClosureProcessHandler}};
|
|
|
|
#[cfg(feature = "draw")] pub mod draw;
|
|
#[cfg(feature = "draw")] pub mod space;
|
|
#[cfg(feature = "draw")] pub mod color;
|
|
#[cfg(feature = "text")] pub mod text;
|
|
#[cfg(feature = "term")] pub mod term;
|
|
#[cfg(feature = "term")] pub mod keys;
|
|
#[cfg(feature = "term")] pub extern crate ratatui;
|
|
#[cfg(feature = "term")] pub extern crate crossterm;
|
|
|
|
/// Define a trait an implement it for various mutation-enabled wrapper types. */
|
|
#[macro_export] macro_rules! flex_trait_mut (
|
|
($Trait:ident $(<$($A:ident:$T:ident),+>)? {
|
|
$(fn $fn:ident (&mut $self:ident $(, $arg:ident:$ty:ty)*) -> $ret:ty $body:block)*
|
|
})=>{
|
|
pub trait $Trait $(<$($A: $T),+>)? {
|
|
$(fn $fn (&mut $self $(,$arg:$ty)*) -> $ret $body)*
|
|
}
|
|
impl<$($($A: $T,)+)? _T_: $Trait $(<$($A),+>)?> $Trait $(<$($A),+>)? for &mut _T_ {
|
|
$(fn $fn (&mut $self $(,$arg:$ty)*) -> $ret { (*$self).$fn($($arg),*) })*
|
|
}
|
|
impl<$($($A: $T,)+)? _T_: $Trait $(<$($A),+>)?> $Trait $(<$($A),+>)? for Option<_T_> {
|
|
$(fn $fn (&mut $self $(,$arg:$ty)*) -> $ret {
|
|
if let Some(this) = $self { this.$fn($($arg),*) } else { Ok(None) }
|
|
})*
|
|
}
|
|
impl<$($($A: $T,)+)? _T_: $Trait $(<$($A),+>)?> $Trait $(<$($A),+>)? for ::std::sync::Mutex<_T_> {
|
|
$(fn $fn (&mut $self $(,$arg:$ty)*) -> $ret { $self.get_mut().unwrap().$fn($($arg),*) })*
|
|
}
|
|
impl<$($($A: $T,)+)? _T_: $Trait $(<$($A),+>)?> $Trait $(<$($A),+>)? for ::std::sync::Arc<::std::sync::Mutex<_T_>> {
|
|
$(fn $fn (&mut $self $(,$arg:$ty)*) -> $ret { $self.lock().unwrap().$fn($($arg),*) })*
|
|
}
|
|
impl<$($($A: $T,)+)? _T_: $Trait $(<$($A),+>)?> $Trait $(<$($A),+>)? for ::std::sync::RwLock<_T_> {
|
|
$(fn $fn (&mut $self $(,$arg:$ty)*) -> $ret { $self.write().unwrap().$fn($($arg),*) })*
|
|
}
|
|
impl<$($($A: $T,)+)? _T_: $Trait $(<$($A),+>)?> $Trait $(<$($A),+>)? for ::std::sync::Arc<::std::sync::RwLock<_T_>> {
|
|
$(fn $fn (&mut $self $(,$arg:$ty)*) -> $ret { $self.write().unwrap().$fn($($arg),*) })*
|
|
}
|
|
};
|
|
);
|