pub struct MapAttachRef { /* private fields */ }Expand description
A reference to a map for the sole purpose of attaching a render session,
produced by MapHandle::attach_ref. Attaching is the one map operation
that runs on the render session’s thread instead of the map’s.
This is a copied handle value and carries no Rust retention of the map. Native destroys a map only once no session is attached, and rejects a reference that outlives its map rather than binding to a later one.
Close the session before the map: dropping a MapHandle with a session
still attached leaks the native map, reports it through
set_leak_reporter, and leaves the runtime
undestroyable.
Implementations§
Source§impl MapAttachRef
impl MapAttachRef
Sourcepub fn attach_metal_surface(
&self,
descriptor: &MetalSurfaceDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_metal_surface( &self, descriptor: &MetalSurfaceDescriptor, ) -> Result<RenderSessionHandle>
Attaches a Metal native surface render target to the map.
The layer and optional device pointers are backend-native handles. They must name valid Metal objects for this session and remain usable on the owner thread until the session is detached or closed.
Sourcepub fn attach_vulkan_surface(
&self,
descriptor: &VulkanSurfaceDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_vulkan_surface( &self, descriptor: &VulkanSurfaceDescriptor, ) -> Result<RenderSessionHandle>
Attaches a Vulkan native surface render target to the map.
Vulkan handles are borrowed. They must remain valid and externally synchronized until the session is detached or closed.
Sourcepub fn attach_webgpu_surface(
&self,
descriptor: &WebGpuSurfaceDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_webgpu_surface( &self, descriptor: &WebGpuSurfaceDescriptor, ) -> Result<RenderSessionHandle>
Attaches a WebGPU native surface render target to the map.
The surface, device, and instance are borrowed. They must stay valid until the session detaches or closes.
Sourcepub fn attach_opengl_surface(
&self,
descriptor: &OpenGLSurfaceDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_opengl_surface( &self, descriptor: &OpenGLSurfaceDescriptor, ) -> Result<RenderSessionHandle>
Attaches an OpenGL native surface render target to the map.
OpenGL context provider and surface handles are borrowed. They must remain valid and externally synchronized until the session is detached or closed.
Sourcepub fn attach_metal_owned_texture(
&self,
descriptor: &MetalOwnedTextureDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_metal_owned_texture( &self, descriptor: &MetalOwnedTextureDescriptor, ) -> Result<RenderSessionHandle>
Attaches a Metal session-owned texture render target to the map.
The device pointer must name a valid Metal device that remains usable on the owner thread until the session is detached or closed.
Sourcepub fn attach_metal_borrowed_texture(
&self,
descriptor: &MetalBorrowedTextureDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_metal_borrowed_texture( &self, descriptor: &MetalBorrowedTextureDescriptor, ) -> Result<RenderSessionHandle>
Attaches a Metal caller-owned texture render target to the map.
The texture pointer is borrowed. The caller owns the texture, keeps it valid until detach or close, and synchronizes use outside this session.
Sourcepub fn attach_vulkan_owned_texture(
&self,
descriptor: &VulkanOwnedTextureDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_vulkan_owned_texture( &self, descriptor: &VulkanOwnedTextureDescriptor, ) -> Result<RenderSessionHandle>
Attaches a Vulkan session-owned texture render target to the map.
Vulkan device and queue handles are borrowed. They must remain valid and externally synchronized until the session is detached or closed.
Sourcepub fn attach_vulkan_borrowed_texture(
&self,
descriptor: &VulkanBorrowedTextureDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_vulkan_borrowed_texture( &self, descriptor: &VulkanBorrowedTextureDescriptor, ) -> Result<RenderSessionHandle>
Attaches a Vulkan caller-owned texture render target to the map.
Vulkan handles, image, and image view are borrowed. The caller owns the image resources, keeps them valid until detach or close, and handles queue-family ownership and synchronization outside this session.
Sourcepub fn attach_webgpu_owned_texture(
&self,
descriptor: &WebGpuOwnedTextureDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_webgpu_owned_texture( &self, descriptor: &WebGpuOwnedTextureDescriptor, ) -> Result<RenderSessionHandle>
Attaches a WebGPU session-owned texture render target to the map.
The WebGPU device and queue are borrowed. They must remain valid until the session is detached or closed, and the session renders on the thread that owns them.
Sourcepub fn attach_webgpu_borrowed_texture(
&self,
descriptor: &WebGpuBorrowedTextureDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_webgpu_borrowed_texture( &self, descriptor: &WebGpuBorrowedTextureDescriptor, ) -> Result<RenderSessionHandle>
Attaches a WebGPU caller-owned texture render target to the map.
The texture and its view are borrowed. The caller owns them, keeps them valid until detach or close, and creates both from the descriptor’s device.
Sourcepub fn attach_opengl_owned_texture(
&self,
descriptor: &OpenGLOwnedTextureDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_opengl_owned_texture( &self, descriptor: &OpenGLOwnedTextureDescriptor, ) -> Result<RenderSessionHandle>
Attaches an OpenGL session-owned texture render target to the map.
The context provider handles are borrowed. They must remain valid until the session is detached or closed. Host sampling must use a context in the same share group while the acquired frame remains open.
Sourcepub fn attach_opengl_borrowed_texture(
&self,
descriptor: &OpenGLBorrowedTextureDescriptor,
) -> Result<RenderSessionHandle>
pub fn attach_opengl_borrowed_texture( &self, descriptor: &OpenGLBorrowedTextureDescriptor, ) -> Result<RenderSessionHandle>
Attaches an OpenGL caller-owned texture render target to the map.
The context provider handles and texture object are borrowed. The caller owns the texture, keeps it valid until detach or close, and synchronizes use outside this session.
Trait Implementations§
Source§impl Clone for MapAttachRef
impl Clone for MapAttachRef
Source§fn clone(&self) -> MapAttachRef
fn clone(&self) -> MapAttachRef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more