pub struct GpuTexture2D(Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>);
Expand description
Handle to a 2D resource.
Currently, this is solely a more strongly typed regular gpu texture handle.
Tuple Fields§
§0: Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
Implementations§
source§impl GpuTexture2D
impl GpuTexture2D
sourcepub fn new(
texture: Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
) -> Option<Self>
pub fn new( texture: Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>> ) -> Option<Self>
Returns None
if the texture
is not 2D.
pub fn handle(&self) -> GpuTextureHandle
sourcepub fn width_height(&self) -> [u32; 2]
pub fn width_height(&self) -> [u32; 2]
Width and height of the texture.
pub fn format(&self) -> TextureFormat
Trait Implementations§
source§impl AsRef<Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>> for GpuTexture2D
impl AsRef<Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>> for GpuTexture2D
source§fn as_ref(
&self
) -> &Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
fn as_ref( &self ) -> &Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Borrow<Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>> for GpuTexture2D
impl Borrow<Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>> for GpuTexture2D
source§fn borrow(
&self
) -> &Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
fn borrow( &self ) -> &Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
Immutably borrows from an owned value. Read more
source§impl Clone for GpuTexture2D
impl Clone for GpuTexture2D
source§fn clone(&self) -> GpuTexture2D
fn clone(&self) -> GpuTexture2D
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 moresource§impl Debug for GpuTexture2D
impl Debug for GpuTexture2D
source§impl Deref for GpuTexture2D
impl Deref for GpuTexture2D
§type Target = Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
type Target = Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
The resulting type after dereferencing.
source§fn deref(
&self
) -> &Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
fn deref( &self ) -> &Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
Dereferences the value.
Auto Trait Implementations§
impl Freeze for GpuTexture2D
impl !RefUnwindSafe for GpuTexture2D
impl Send for GpuTexture2D
impl Sync for GpuTexture2D
impl Unpin for GpuTexture2D
impl !UnwindSafe for GpuTexture2D
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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