Lines Matching full:opaque
252 /// Stores an opaque value.
254 /// [`Opaque<T>`] is meant to be used with FFI objects that are never interpreted by Rust code.
256 /// It is used to wrap structs from the C side, like for example `Opaque<bindings::mutex>`.
261 /// * The value is allowed to be mutated, when a `&Opaque<T>` exists on the Rust side.
262 /// * No uniqueness for mutable references: it is fine to have multiple `&mut Opaque<T>` point to
269 /// Using [`Opaque<T>`] allows to continue to use references on the Rust side even for values shared
276 /// use kernel::types::Opaque;
285 /// // `foo.val` is assumed to be handled on the C side, so we use `Opaque` to wrap it.
287 /// foo: Opaque<bindings::Foo>,
292 /// let ptr = Opaque::get(&self.foo);
299 /// // Create an instance of `Foo` with the `Opaque` wrapper.
301 /// foo: Opaque::new(bindings::Foo { val: 0xdb }),
307 pub struct Opaque<T> { struct
312 // SAFETY: `Opaque<T>` allows the inner value to be any bit pattern, including all zeros. argument
313 unsafe impl<T> Zeroable for Opaque<T> {} implementation
315 impl<T> Opaque<T> { implementation
316 /// Creates a new opaque value.
332 /// Create an opaque pin-initializer from the given pin-initializer.
346 /// `Opaque`. Since this memory is uninitialized, the closure is not allowed to read from it.
348 /// This function is safe, because the `T` inside of an `Opaque` is allowed to be
365 /// `Opaque`. Since this memory is uninitialized, the closure is not allowed to read from it.
367 /// This function is safe, because the `T` inside of an `Opaque` is allowed to be
380 /// Returns a raw pointer to the opaque data.