pub struct RendererTarget<'a> {
pub window_handle: Option<RawWindowHandle>,
pub display_handle: Option<RawDisplayHandle>,
pub size: Size<Pixels>,
pub scale_factor: f32,
pub transparent: bool,
pub backend: Option<&'a (dyn Any + 'static)>,
}Expand description
What a renderer is built against: the window’s handles, its geometry, and whatever the backend needs to add.
The handles are typed rather than erased, because erasing them would make any renderer that is not the backend’s own downcast to the backend’s target type — which means depending on the backend crate. The backend’s own extras are the one erased field.
Fields§
§window_handle: Option<RawWindowHandle>The window’s raw handle, which the renderer builds its surface from.
display_handle: Option<RawDisplayHandle>The display the window is on, for the same.
size: Size<Pixels>The window’s size, in logical pixels.
scale_factor: f32The ratio between logical pixels and device pixels.
transparent: boolWhether the window is transparent.
backend: Option<&'a (dyn Any + 'static)>Backend-specific extras, for that backend’s own renderer only. Any is 'static, so
this must point at owned data; a backend with nothing to add passes None.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for RendererTarget<'a>
impl<'a> !Send for RendererTarget<'a>
impl<'a> !Sync for RendererTarget<'a>
impl<'a> !UnwindSafe for RendererTarget<'a>
impl<'a> Freeze for RendererTarget<'a>
impl<'a> Unpin for RendererTarget<'a>
impl<'a> UnsafeUnpin for RendererTarget<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more