#[non_exhaustive]pub struct OpaqueStruct {
pub name: Ident,
pub docs: Docs,
pub lifetimes: LifetimeEnv,
pub methods: Vec<Method>,
pub mutability: Mutability,
pub attrs: Attrs,
}
Expand description
A struct annotated with [diplomat::opaque
] whose fields are not visible.
Opaque structs cannot be passed by-value across the FFI boundary, so they
must be boxed or passed as references.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.name: Ident
§docs: Docs
§lifetimes: LifetimeEnv
§methods: Vec<Method>
§mutability: Mutability
§attrs: Attrs
Implementations§
source§impl OpaqueStruct
impl OpaqueStruct
sourcepub fn new(
strct: &ItemStruct,
mutability: Mutability,
parent_attrs: &Attrs,
) -> Self
pub fn new( strct: &ItemStruct, mutability: Mutability, parent_attrs: &Attrs, ) -> Self
Extract a OpaqueStruct
metadata value from an AST node.
Trait Implementations§
source§impl Clone for OpaqueStruct
impl Clone for OpaqueStruct
source§fn clone(&self) -> OpaqueStruct
fn clone(&self) -> OpaqueStruct
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for OpaqueStruct
impl Debug for OpaqueStruct
source§impl Hash for OpaqueStruct
impl Hash for OpaqueStruct
source§impl PartialEq for OpaqueStruct
impl PartialEq for OpaqueStruct
source§impl Serialize for OpaqueStruct
impl Serialize for OpaqueStruct
impl Eq for OpaqueStruct
impl StructuralPartialEq for OpaqueStruct
Auto Trait Implementations§
impl Freeze for OpaqueStruct
impl RefUnwindSafe for OpaqueStruct
impl !Send for OpaqueStruct
impl !Sync for OpaqueStruct
impl Unpin for OpaqueStruct
impl UnwindSafe for OpaqueStruct
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)