#[repr(transparent)]
pub struct Opaque<T>(_);
Expand description

Stores an opaque value.

This is meant to be used with FFI objects that are never interpreted by Rust code.

Implementations

Creates a new opaque value.

Creates an uninitialised value.

Creates a pin-initializer from the given initializer closure.

The returned initializer calls the given closure with the pointer to the inner T of this Opaque. Since this memory is uninitialized, the closure is not allowed to read from it.

This function is safe, because the T inside of an Opaque is allowed to be uninitialized. Additionally, access to the inner T requires unsafe, so the caller needs to verify at that point that the inner value is valid.

Returns a raw pointer to the opaque data.

Gets the value behind this.

This function is useful to get access to the value without creating intermediate references.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Initializes slot. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Initializes slot. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

This documentation is an old archive. Please see https://rust.docs.kernel.org instead.