#[non_exhaustive]pub enum CustomType {
Struct(Struct),
Opaque(OpaqueStruct),
Enum(Enum),
}
Expand description
A type declared inside a Diplomat-annotated module.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Struct(Struct)
A non-opaque struct whose fields will be visible across the FFI boundary.
Opaque(OpaqueStruct)
A struct annotated with [diplomat::opaque
] whose fields are not visible.
Enum(Enum)
A fieldless enum.
Implementations§
source§impl CustomType
impl CustomType
pub fn attrs(&self) -> &Attrs
sourcepub fn all_rust_links(&self) -> impl Iterator<Item = &RustLink> + '_
pub fn all_rust_links(&self) -> impl Iterator<Item = &RustLink> + '_
Get all rust links on this type and its methods
pub fn self_path(&self, in_path: &Path) -> Path
sourcepub fn lifetimes(&self) -> Option<&LifetimeEnv>
pub fn lifetimes(&self) -> Option<&LifetimeEnv>
Get the lifetimes of the custom type.
Trait Implementations§
source§impl Clone for CustomType
impl Clone for CustomType
source§fn clone(&self) -> CustomType
fn clone(&self) -> CustomType
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 CustomType
impl Debug for CustomType
source§impl Hash for CustomType
impl Hash for CustomType
source§impl PartialEq for CustomType
impl PartialEq for CustomType
source§impl Serialize for CustomType
impl Serialize for CustomType
impl Eq for CustomType
impl StructuralPartialEq for CustomType
Auto Trait Implementations§
impl Freeze for CustomType
impl RefUnwindSafe for CustomType
impl !Send for CustomType
impl !Sync for CustomType
impl Unpin for CustomType
impl UnwindSafe for CustomType
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
)