Struct rutabaga_gfx::RutabagaDescriptor
source · pub struct RutabagaDescriptor { /* private fields */ }
Expand description
Wraps a RawDescriptor and safely closes it when self falls out of scope.
Implementations§
source§impl SafeDescriptor
impl SafeDescriptor
sourcepub fn try_clone(&self) -> Result<SafeDescriptor, Error>
pub fn try_clone(&self) -> Result<SafeDescriptor, Error>
Clones this descriptor, internally creating a new descriptor. The new SafeDescriptor will share the same underlying count within the kernel.
Trait Implementations§
source§impl AsRawDescriptor for SafeDescriptor
impl AsRawDescriptor for SafeDescriptor
source§fn as_raw_descriptor(&self) -> i64
fn as_raw_descriptor(&self) -> i64
source§impl Drop for SafeDescriptor
impl Drop for SafeDescriptor
source§impl From<File> for SafeDescriptor
impl From<File> for SafeDescriptor
source§fn from(f: File) -> SafeDescriptor
fn from(f: File) -> SafeDescriptor
source§impl From<SafeDescriptor> for File
impl From<SafeDescriptor> for File
source§fn from(_s: SafeDescriptor) -> File
fn from(_s: SafeDescriptor) -> File
source§impl FromRawDescriptor for SafeDescriptor
impl FromRawDescriptor for SafeDescriptor
source§unsafe fn from_raw_descriptor(descriptor: i64) -> Self
unsafe fn from_raw_descriptor(descriptor: i64) -> Self
§Safety
Safe only if the caller ensures nothing has access to the descriptor after passing it to
from_raw_descriptor
source§impl IntoRawDescriptor for SafeDescriptor
impl IntoRawDescriptor for SafeDescriptor
fn into_raw_descriptor(self) -> i64
source§impl TryFrom<&dyn AsRawDescriptor> for SafeDescriptor
impl TryFrom<&dyn AsRawDescriptor> for SafeDescriptor
source§fn try_from(rd: &dyn AsRawDescriptor) -> Result<Self, Self::Error>
fn try_from(rd: &dyn AsRawDescriptor) -> Result<Self, Self::Error>
Clones the underlying descriptor (handle), internally creating a new descriptor.
WARNING: Windows does NOT support cloning/duplicating all types of handles. DO NOT use this function on IO completion ports, sockets, or pseudo-handles (except those from GetCurrentProcess or GetCurrentThread). See https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-duplicatehandle for further details.
TODO(b/191800567): this API has sharp edges on Windows. We should evaluate making some adjustments to smooth those edges.