mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2025-12-07 04:06:48 +01:00
output: update README
This commit is contained in:
parent
d92e5efdd0
commit
3e2b07158c
5 changed files with 28 additions and 79 deletions
|
|
@ -10,7 +10,7 @@ pub(crate) use tengri_core::*;
|
|||
#[cfg(feature = "dsl")] pub(crate) use ::tengri_dsl::*;
|
||||
|
||||
mod space; pub use self::space::*;
|
||||
mod ops; pub use self::ops::*;
|
||||
mod layout; pub use self::layout::*;
|
||||
mod output; pub use self::output::*;
|
||||
|
||||
#[cfg(test)] mod test;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ impl<E: Output, C: Content<E>> Render<E> for C {
|
|||
/// Opaque pointer to a renderable living on the heap.
|
||||
///
|
||||
/// Return this from [Content::content] to use dynamic dispatch.
|
||||
pub type RenderBox<E> = Box<RenderDyn<E>>;
|
||||
pub type RenderBox<E> = Box<dyn Render<E>>;
|
||||
|
||||
/// You can render from a box.
|
||||
impl<E: Output> Content<E> for RenderBox<E> {
|
||||
|
|
@ -55,11 +55,8 @@ impl<E: Output> Content<E> for RenderBox<E> {
|
|||
//fn boxed <'b> (self) -> RenderBox<'b, E> where Self: Sized + 'b { self }
|
||||
}
|
||||
|
||||
/// Opaque pointer to a renderable.
|
||||
pub type RenderDyn<E> = dyn Render<E>;
|
||||
|
||||
/// You can render from an opaque pointer.
|
||||
impl<E: Output> Content<E> for &RenderDyn<E> where Self: Sized {
|
||||
impl<E: Output> Content<E> for &dyn Render<E> where Self: Sized {
|
||||
fn content (&self) -> impl Render<E> + '_ {
|
||||
#[allow(suspicious_double_ref_op)]
|
||||
self.deref()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue