Skip to main content

MapAttachRef

Struct MapAttachRef 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> MapAttachRef

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MapAttachRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for MapAttachRef

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.