Trait unsafe_io::AsUnsafeHandle[][src]

pub unsafe trait AsUnsafeHandle {
    fn as_unsafe_handle(&self) -> UnsafeHandle;

    fn eq_handle<Handlelike: AsUnsafeHandle>(&self, other: &Handlelike) -> bool { ... }
}

A trait for types which contain an unsafe handle and can expose it.

A type implementing AsUnsafeHandle guarantees that the return value from as_unsafe_handle on an instance of the type is a copy of a handle which is owned.

Safety

This trait is unsafe because types implementing it must guarantee they own their handle.

Required methods

fn as_unsafe_handle(&self) -> UnsafeHandle[src]

Return the contained unsafe handle.

Loading content...

Provided methods

fn eq_handle<Handlelike: AsUnsafeHandle>(&self, other: &Handlelike) -> bool[src]

Test whether self.as_unsafe_handle() is equal to other.as_unsafe_handle().

That this depends on the guarantee that types that implement AsUnsafeHandle own their resources, so we won’t erroneously compare dangling handles.

Loading content...

Implementors

Loading content...