mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-09-18 05:16:44 +02:00
remove unused and commented stuff
This commit is contained in:
parent
7c9816a07e
commit
e55a7da3b4
1 changed files with 0 additions and 44 deletions
44
src/lib.rs
44
src/lib.rs
|
|
@ -1316,16 +1316,6 @@ pub trait AsMutOpt<T> { fn as_mut_opt (&mut self) -> Option<&mut T>; }
|
||||||
|
|
||||||
/// Drawable that supports dynamic dispatch.
|
/// Drawable that supports dynamic dispatch.
|
||||||
///
|
///
|
||||||
/// Drawables are composable, e.g. the [when] and [either] conditionals
|
|
||||||
/// or the layout constraints.
|
|
||||||
///
|
|
||||||
/// Drawables are consumable, i.e. the [Draw::draw] method receives an
|
|
||||||
/// owned `self` and does not return it, consuming the drawable.
|
|
||||||
///
|
|
||||||
/// To draw a thing multiple times, instead of explicitly constructing it
|
|
||||||
/// every time, implement the [View] trait instead, which will construct
|
|
||||||
/// a [Draw]able.
|
|
||||||
///
|
|
||||||
/// ```
|
/// ```
|
||||||
/// use tengri::*;
|
/// use tengri::*;
|
||||||
/// struct MyWidget(bool);
|
/// struct MyWidget(bool);
|
||||||
|
|
@ -1339,39 +1329,6 @@ pub trait AsMutOpt<T> { fn as_mut_opt (&mut self) -> Option<&mut T>; }
|
||||||
fn draw (&self, to: &mut S) -> Drawn<S::Unit>;
|
fn draw (&self, to: &mut S) -> Drawn<S::Unit>;
|
||||||
}
|
}
|
||||||
|
|
||||||
///// Emit a [Draw]able.
|
|
||||||
/////
|
|
||||||
///// Speculative. How to avoid conflicts with [Draw] proper?
|
|
||||||
//pub trait View<T: Screen> {
|
|
||||||
//fn view (&self) -> impl Draw<T> ;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//impl<T: Screen> View<T> for () {
|
|
||||||
//fn view (&self) -> impl Draw<T> {
|
|
||||||
//()
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// Return a [Draw]able.
|
|
||||||
/////
|
|
||||||
///// ```
|
|
||||||
///// # use tengri::*;
|
|
||||||
///// let _ = view::<Tui, _, _>(||"drawable");
|
|
||||||
///// let _ = view::<Tui, _, _>(||Some("drawable"));
|
|
||||||
///// ```
|
|
||||||
//pub const fn view <S: Screen, T: for<'a> Draw<S>, F: Fn()->T> (view: F) -> impl View<S> {
|
|
||||||
//ViewThunk(view, PhantomData)
|
|
||||||
//}
|
|
||||||
|
|
||||||
///// Because we can't implement [Draw] for `F: FnOnce...` without conflicts.
|
|
||||||
//pub struct ViewThunk<S: Screen, F>(pub F, std::marker::PhantomData<S>);
|
|
||||||
|
|
||||||
//impl<S: Screen, T: for<'a> Draw<S>, F: Fn()->T> View<S> for ViewThunk<S, F> {
|
|
||||||
//fn view (&self) -> impl Draw<S> {
|
|
||||||
//self.0()
|
|
||||||
//}
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// Because we can't implement [Draw] for `F: FnOnce...` without conflicts.
|
/// Because we can't implement [Draw] for `F: FnOnce...` without conflicts.
|
||||||
pub struct DrawThunk<S: Screen, F>(pub F, std::marker::PhantomData<S>);
|
pub struct DrawThunk<S: Screen, F>(pub F, std::marker::PhantomData<S>);
|
||||||
|
|
||||||
|
|
@ -1646,7 +1603,6 @@ pub trait AsMutOpt<T> { fn as_mut_opt (&mut self) -> Option<&mut T>; }
|
||||||
#[cfg(feature = "draw")] pub use self::color::*;
|
#[cfg(feature = "draw")] pub use self::color::*;
|
||||||
#[cfg(feature = "draw")] mod color {
|
#[cfg(feature = "draw")] mod color {
|
||||||
use crate::*;
|
use crate::*;
|
||||||
use dizzle::LanguageErrorKind::*;
|
|
||||||
use ::ratatui::style::Color;
|
use ::ratatui::style::Color;
|
||||||
use ::rand::distributions::uniform::UniformSampler;
|
use ::rand::distributions::uniform::UniformSampler;
|
||||||
pub(crate) use ::palette::{
|
pub(crate) use ::palette::{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue