[][src]Struct shoebill::Renderable

pub struct Renderable<'x, 'p: 'x, P: HasPrinter<'p>> { /* fields omitted */ }

Renderable is a separate thing so that we can use it with format! and write! style macros. This has two lifetimes so that you can have multiple Renderable structs in one scope as long as their lifetimes don't overlap. If we ONLY had the <'p> lifetime, we wouldn't be able to do something like:

 //let s1 = format!("{}", d1.render(printer));
 //let s2 = format!("{}", d2.render(printer));

without getting an error that printer was still borrwed by the first statement, since the borrow by render would be believed to have duration <'p>

Trait Implementations

impl<'x, 'p: 'x, P: HasPrinter<'p>> Display for Renderable<'x, 'p, P>[src]

By implementing this as an instance of Display for Renderable, you can render something directly to some sink (as a Formatter) without having to build the actual string first and then write it.

Auto Trait Implementations

impl<'x, 'p, P> RefUnwindSafe for Renderable<'x, 'p, P> where
    P: RefUnwindSafe

impl<'x, 'p, P> Send for Renderable<'x, 'p, P> where
    P: Sync

impl<'x, 'p, P> Sync for Renderable<'x, 'p, P> where
    P: Sync

impl<'x, 'p, P> Unpin for Renderable<'x, 'p, P>

impl<'x, 'p, P> UnwindSafe for Renderable<'x, 'p, P> where
    P: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.