[][src]Struct jlrs::value::datatype::DataType

#[repr(transparent)]pub struct DataType<'frame>(_, _);

Julia type information. You can acquire a Value's datatype by by calling Value::datatype. This struct implements JuliaTypecheck and Cast. It can be used in combination with DataType::is and Value::is; if the check returns true the Value can be cast to DataType:

julia.frame(2, |global, frame| {
    let val = Value::new(frame, 1u8)?;
    let typeof_func = Module::core(global).function("typeof")?;
    let ty_val = typeof_func.call1(frame, val)?.unwrap();
    assert!(ty_val.is::<DataType>());
    assert!(ty_val.cast::<DataType>().is_ok());
    Ok(())
}).unwrap();

Implementations

impl<'frame> DataType<'frame>[src]

pub fn is<T: JuliaTypecheck>(self) -> bool[src]

Performs the given typecheck.

pub fn size(self) -> i32[src]

Returns the size of a value of this type in bytes.

pub fn align(self) -> u16[src]

Returns the alignment of a value of this type in bytes.

pub fn nbits(self) -> i32[src]

Returns the alignment of a value of this type in bits.

pub fn nfields(self) -> u32[src]

Returns the number of fields of a value of this type.

pub fn isinlinealloc(self) -> bool[src]

Returns true if a value of this type stores its data inline.

Trait Implementations

impl<'frame, 'data> Cast<'frame, 'data> for DataType<'frame>[src]

type Output = Self

impl<'frame> Clone for DataType<'frame>[src]

impl<'frame> Copy for DataType<'frame>[src]

impl<'frame> JuliaTypecheck for DataType<'frame>[src]

Auto Trait Implementations

impl<'frame> RefUnwindSafe for DataType<'frame>

impl<'frame> !Send for DataType<'frame>

impl<'frame> !Sync for DataType<'frame>

impl<'frame> Unpin for DataType<'frame>

impl<'frame> UnwindSafe for DataType<'frame>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.