pub struct OffscreenDeviceHandle { /* private fields */ }Expand description
Owns one native handle.
A GPU device that the library creates to render maps offscreen.
See mln_offscreen_device in the
C API reference.
Implementations§
Source§impl OffscreenDeviceHandle
impl OffscreenDeviceHandle
Sourcepub fn create(
options: Option<&OffscreenDeviceOptions>,
) -> Result<OffscreenDeviceHandle>
pub fn create( options: Option<&OffscreenDeviceOptions>, ) -> Result<OffscreenDeviceHandle>
Creates a GPU device for rendering maps offscreen.
MapHandle::attach_offscreen() creates a device of its own when it gets
none. Create one to share it among the sessions on many maps, or to pick
a GPU.
In a browser WebGPU build, attach without a device instead.
See mln_offscreen_device_create in the
C API reference.
§Errors
Status::Unsupportedin a browser WebGPU build, or when the device can’t render withclient_api.Status::NativeErrorwhenadapter_indexnames no GPU, or the platform can’t create the device.
Sourcepub fn release(self) -> Result<(), ReleaseError<Self>>
pub fn release(self) -> Result<(), ReleaseError<Self>>
Releases an offscreen device.
Render sessions on the device keep working until they detach.
See mln_offscreen_device_release in the
C API reference.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OffscreenDeviceHandle
impl RefUnwindSafe for OffscreenDeviceHandle
impl Send for OffscreenDeviceHandle
impl Sync for OffscreenDeviceHandle
impl Unpin for OffscreenDeviceHandle
impl UnsafeUnpin for OffscreenDeviceHandle
impl UnwindSafe for OffscreenDeviceHandle
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> ErasedDestructor for Twhere
T: 'static,
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