rutabaga_gfx

Struct 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

Source

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

Source§

fn as_raw_descriptor(&self) -> i64

Returns the underlying raw descriptor. Read more
Source§

impl Drop for SafeDescriptor

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<File> for SafeDescriptor

Source§

fn from(f: File) -> SafeDescriptor

Converts to this type from the input type.
Source§

impl From<SafeDescriptor> for File

Source§

fn from(_s: SafeDescriptor) -> File

Converts to this type from the input type.
Source§

impl FromRawDescriptor for SafeDescriptor

Source§

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

Source§

impl TryFrom<&dyn AsRawDescriptor> for SafeDescriptor

Source§

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.

Source§

type Error = Error

The type returned in the event of a conversion error.

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> 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, 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.