pub struct LeasedOffscreen {
pub width: u32,
pub height: u32,
/* private fields */
}Expand description
Lightweight handle to one currently leased pool slot.
A lease is meaningful only with the pool that created it. It does not own or automatically release the slot, and copying it does not create a new lease.
§Examples
use ailloli_ui_render_wgpu::offscreen_pool::LeasedOffscreen;
let _: usize = std::mem::size_of::<LeasedOffscreen>();Fields§
§width: u32Slot width in physical pixels.
height: u32Slot height in physical pixels.
Implementations§
Source§impl LeasedOffscreen
impl LeasedOffscreen
Sourcepub fn color_view<'a>(&self, pool: &'a OffscreenSurfacePool) -> &'a TextureView
pub fn color_view<'a>(&self, pool: &'a OffscreenSurfacePool) -> &'a TextureView
Returns the slot’s full color view.
§Panics
Panics if used with a different or structurally corrupted pool.
§Examples
use ailloli_ui_render_wgpu::offscreen_pool::{LeasedOffscreen, OffscreenSurfacePool};
fn view<'a>(lease: &LeasedOffscreen, pool: &'a OffscreenSurfacePool)
-> &'a wgpu::TextureView { lease.color_view(pool) }Sourcepub fn color_texture<'a>(&self, pool: &'a OffscreenSurfacePool) -> &'a Texture
pub fn color_texture<'a>(&self, pool: &'a OffscreenSurfacePool) -> &'a Texture
Returns the slot’s owned color texture for copy operations.
§Panics
Panics if used with a different or structurally corrupted pool.
§Examples
use ailloli_ui_render_wgpu::offscreen_pool::{LeasedOffscreen, OffscreenSurfacePool};
fn texture<'a>(lease: &LeasedOffscreen, pool: &'a OffscreenSurfacePool)
-> &'a wgpu::Texture { lease.color_texture(pool) }Sourcepub fn stencil_view<'a>(
&self,
pool: &'a OffscreenSurfacePool,
) -> Option<&'a TextureView>
pub fn stencil_view<'a>( &self, pool: &'a OffscreenSurfacePool, ) -> Option<&'a TextureView>
Returns the optional stencil view requested by the slot’s key.
§Examples
use ailloli_ui_render_wgpu::offscreen_pool::{LeasedOffscreen, OffscreenSurfacePool};
fn stencil<'a>(lease: &LeasedOffscreen, pool: &'a OffscreenSurfacePool)
-> Option<&'a wgpu::TextureView> { lease.stencil_view(pool) }Trait Implementations§
Source§impl Clone for LeasedOffscreen
impl Clone for LeasedOffscreen
Source§fn clone(&self) -> LeasedOffscreen
fn clone(&self) -> LeasedOffscreen
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LeasedOffscreen
Auto Trait Implementations§
impl Freeze for LeasedOffscreen
impl RefUnwindSafe for LeasedOffscreen
impl Send for LeasedOffscreen
impl Sync for LeasedOffscreen
impl Unpin for LeasedOffscreen
impl UnwindSafe for LeasedOffscreen
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.
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