pub trait AsRawDescriptor {
    // Required method
    fn as_raw_descriptor(&self) -> RawDescriptor;
}
Expand description

Trait for returning the underlying raw descriptor, without giving up ownership of the descriptor.

Required Methods§

source

fn as_raw_descriptor(&self) -> RawDescriptor

Returns the underlying raw descriptor.

Since the descriptor is still owned by the provider, callers should not assume that it will remain open for longer than the immediate call of this method. In particular, it is a dangerous practice to store the result of this method for future use: instead, it should be used to e.g. obtain a raw descriptor that is immediately passed to a system call.

If you need to use the descriptor for a longer time (and particularly if you cannot reliably track the lifetime of the providing object), you should probably consider using OwnedDescriptor (possibly along with IntoRawDescriptor) to get full ownership over a descriptor pointing to the same resource.

Implementations on Foreign Types§

source§

impl AsRawDescriptor for File

Implementors§

source§

impl AsRawDescriptor for rutabaga_gfx::rutabaga_os::shm::SharedMemory

source§

impl AsRawDescriptor for OwnedDescriptor

source§

impl AsRawDescriptor for WritePipe

source§

impl AsRawDescriptor for rutabaga_gfx::rutabaga_os::sys::linux::shm::SharedMemory