#[non_exhaustive]pub enum HsType {
}Expand description
Enumeration of all Haskell C-FFI safe types as the string representation of their token in Haskell.
FIXME: Errno(c_int) should be implemented as a Rust enum …
https://hackage.haskell.org/package/base/docs/Foreign-C-Error.html
… using #[repr(i32)] https://doc.rust-lang.org/nomicon/other-reprs.html
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.
CInt
Int32
CChar
Int8
CSChar
Int8
CUChar
Word8
CShort
Int16
CUShort
Word16
CUInt
Word32
CLong
Int64
CULong
Word64
CLLong
Int64
CULLong
Word64
CBool
Word8
CString
Ptr CChar
CDouble
Double
CFloat
Float
Empty
()
Ptr(Box<HsType>)
Ptr T
IO(Box<HsType>)
IO T
FunPtr(Vec<HsType>)
FunPtr (S -> T)
Implementations§
Source§impl HsType
impl HsType
Sourcepub fn quote(&self) -> TokenStream
pub fn quote(&self) -> TokenStream
Get the C-FFI Rust type that match the memory layout of a given HsType.
This function return a OUTPUT: proc_macro2::TokenStream that should
be valid (considered as FFI-safe by rustc) in the context of a block
of form: quote! { extern C fn _(_: #OUTPUT) {} }
c.f. https://doc.rust-lang.org/core/ffi/
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HsType
impl RefUnwindSafe for HsType
impl Send for HsType
impl Sync for HsType
impl Unpin for HsType
impl UnwindSafe for HsType
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