[−][src]Struct jlrs::value::datatype::DataType
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
fn cast(value: Value<'frame, 'data>) -> JlrsResult<Self::Output>
[src]
unsafe fn cast_unchecked<'fr, 'da>(value: Value<'frame, 'data>) -> Self::Output
[src]
impl<'frame> Clone for DataType<'frame>
[src]
impl<'frame> Copy for DataType<'frame>
[src]
impl<'frame> JuliaTypecheck for DataType<'frame>
[src]
unsafe fn julia_typecheck(t: DataType) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,