diff --git a/src/draw.rs b/src/draw.rs index a76126b..df505d3 100644 --- a/src/draw.rs +++ b/src/draw.rs @@ -46,21 +46,26 @@ pub use self::screen::*; /// } /// } /// ``` -pub trait Draw { - fn draw (self, to: &mut T) -> Usually>; +pub trait Draw { + fn draw (self, to: &mut S) -> Usually>; } -impl Draw for () { - fn draw (self, __: &mut T) -> Usually> { +impl Draw for () { + fn draw (self, __: &mut S) -> Usually> { Ok(Default::default()) } } -impl> Draw for &D { - fn draw (self, __: &mut T) -> Usually> { +impl> Draw for &D { + fn draw (self, __: &mut S) -> Usually> { todo!() } } -impl> Draw for Option { - fn draw (self, __: &mut T) -> Usually> { +impl> Draw for Option { + fn draw (self, __: &mut S) -> Usually> { + todo!() + } +} +impl> Draw for RwLock { + fn draw (self, __: &mut S) -> Usually> { todo!() } } diff --git a/src/text.rs b/src/text.rs index c9752a4..9943d4b 100644 --- a/src/text.rs +++ b/src/text.rs @@ -12,11 +12,13 @@ pub(crate) use ::unicode_width::*; to.text(&self, x, y, w) } } + impl Draw for String { fn draw (self, to: &mut Tui) -> Usually> { self.as_str().draw(to) } } + impl Draw for &std::sync::Arc { fn draw (self, to: &mut Tui) -> Usually> { self.as_ref().draw(to)