pub struct Type(/* private fields */);
Expand description
Represents a single C type.
§Example
Suppose we have a C struct:
struct my_struct {
uint16_t f1;
uint64_t f2;
};
To pass the struct by value via libffi, we need to construct a
Type
object describing its layout:
use deno_libffi::middle::Type;
let my_struct = Type::structure(vec![
Type::u64(),
Type::u16(),
]);
Implementations§
Source§impl Type
impl Type
Sourcepub fn void() -> Self
pub fn void() -> Self
Returns the representation of the C void
type.
This is used only for the return type of a CIF, not for an argument or struct member.
Sourcepub fn c_longlong() -> Self
pub fn c_longlong() -> Self
Returns the C longlong
type.
Sourcepub fn c_ulonglong() -> Self
pub fn c_ulonglong() -> Self
Returns the C unsigned longlong
type.
Sourcepub fn longdouble() -> Self
pub fn longdouble() -> Self
Returns the C long double
(extended-precision floating point) type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl !Send for Type
impl !Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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