pub struct TextureData<'data, U = DynamicTextureUsages> { /* private fields */ }Implementations§
Source§impl<'data> TextureData<'data, TextureNoUsages>
impl<'data> TextureData<'data, TextureNoUsages>
Source§impl<'data, U> TextureData<'data, U>
impl<'data, U> TextureData<'data, U>
Sourcepub fn read(self) -> TextureData<'data, U::Out>where
U: Use<dyn Read>,
pub fn read(self) -> TextureData<'data, U::Out>where
U: Use<dyn Read>,
Enables the read usage.
This allows the texture to be used for reading. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn write(self) -> TextureData<'data, U::Out>where
U: Use<dyn Write>,
pub fn write(self) -> TextureData<'data, U::Out>where
U: Use<dyn Write>,
Enables the write usage.
This allows the texture to be used for writing. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn copy_from(self) -> TextureData<'data, U::Out>where
U: Use<dyn CopyFrom>,
pub fn copy_from(self) -> TextureData<'data, U::Out>where
U: Use<dyn CopyFrom>,
Enables the copy from usage.
This allows the texture to be used for coping from it. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn copy_to(self) -> TextureData<'data, U::Out>where
U: Use<dyn CopyTo>,
pub fn copy_to(self) -> TextureData<'data, U::Out>where
U: Use<dyn CopyTo>,
Enables the copy to usage.
This allows the texture to be used for coping to it. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn bind(self) -> TextureData<'data, U::Out>where
U: Use<dyn Bind>,
pub fn bind(self) -> TextureData<'data, U::Out>where
U: Use<dyn Bind>,
Enables the bind usage.
This allows the texture to be used for binding to read in a shader. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn render(self) -> TextureData<'data, U::Out>where
U: Use<dyn Render>,
pub fn render(self) -> TextureData<'data, U::Out>where
U: Use<dyn Render>,
Enables the render usage.
This allows the texture to be used for render into it. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn erase(self) -> TextureData<'data>where
U: TextureUsages,
pub fn erase(self) -> TextureData<'data>where
U: TextureUsages,
Erases the static type information about usages.
The full static type of a texture includes information about all of its usages,
for example: Texture2d<Texture<false, false, true, true>>.
This enables compile-time checks for required usages - for example,
you won’t be able to render to a texture without the render usage.
However, this strict typing significantly complicates type management.
As a compromise, you can call this method to erase usage information from the type, which moves the checks to runtime instead. In this case, using the texture in a context where the required usage is missing will cause a panic.