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

#[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 size 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.

pub fn name(self) -> &'frame str[src]

Returns the name of this type.

pub fn type_name(self) -> TypeName<'frame>[src]

Returns the TypeName of this type.

pub fn field_names(self) -> &'frame [Symbol<'frame>][src]

Returns the field names of this type as a slice of Symbols. These symbols can be used to access their fields with Value::get_field.

pub fn field_types(self) -> &'frame [Value<'frame, 'static>][src]

Returns the field types of this type.

pub fn field_size(self, idx: usize) -> u32[src]

Returns the size of the field at position idx in this type.

pub fn field_offset(self, idx: usize) -> u32[src]

Returns the offset where the field at position idx is stored.

pub fn is_pointer_field(self, idx: usize) -> bool[src]

Returns true if the field at position idx is a pointer.

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

Returns true if this type is a bits-type.

pub fn super_type(self) -> Option<Self>[src]

Returns the supertype of this type.

pub fn parameters(self) -> &'frame [Value<'frame, 'static>][src]

Returns the type parameters of this type.

pub fn instance(self) -> Option<Value<'frame, 'static>>[src]

Returns the instance if this type is a singleton.

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

Returns the number of initialized fields.

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

Returns the hash of this type.

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

Returns true if this is an abstract type.

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

Returns true if this is a mutable type.

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

Returns true if one or more of the type parameters has not been set.

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

Returns true if this type can have instances

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

Returns true if this type is a dispatch, or leaf, tuple type.

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

Returns true if one or more fields require zero-initialization.

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

If false, no value will have this type.

pub fn as_value(self) -> Value<'frame, 'static>[src]

Convert self to a Value. Convert self to a Value.

pub fn instantiate<'fr, 'value, 'borrow, F, V>(
    self,
    frame: &mut F,
    values: V
) -> JlrsResult<Value<'fr, 'borrow>> where
    F: Frame<'fr>,
    V: AsMut<[Value<'value, 'borrow>]>, 
[src]

Intantiate this DataType with the given values. The type must be concrete. One free slot on the GC stack is required for this function to succeed, returns an error if no slot is available or if the type is not concrete.

pub fn instantiate_output<'output, 'fr, 'value, 'borrow, F, V>(
    self,
    frame: &mut F,
    output: Output<'output>,
    values: V
) -> JlrsResult<Value<'output, 'borrow>> where
    F: Frame<'fr>,
    V: AsMut<[Value<'value, 'borrow>]>, 
[src]

Intantiate this DataType with the given values using the given output. The type must be concrete, returns an error if the type is not concrete.

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

pub fn typeofbottom_type(_: Global<'base>) -> Self[src]

The type of the bottom type, Union{}.

pub fn datatype_type(_: Global<'base>) -> Self[src]

The type DataType.

pub fn uniontype_type(_: Global<'base>) -> Self[src]

The type Union.

pub fn unionall_type(_: Global<'base>) -> Self[src]

The type UnionAll.

pub fn tvar_type(_: Global<'base>) -> Self[src]

The type TypeVar.

pub fn any_type(_: Global<'base>) -> Self[src]

The type Any.

pub fn typename_type(_: Global<'base>) -> Self[src]

The type TypeName.

pub fn symbol_type(_: Global<'base>) -> Self[src]

The type Symbol.

pub fn ssavalue_type(_: Global<'base>) -> Self[src]

The type Core.SSAValue.

pub fn abstractslot_type(_: Global<'base>) -> Self[src]

The type Slot.

pub fn slotnumber_type(_: Global<'base>) -> Self[src]

The type SlotNumber.

pub fn typedslot_type(_: Global<'base>) -> Self[src]

The type TypedSlot.

pub fn simplevector_type(_: Global<'base>) -> Self[src]

The type SimpleVector, or SVec.

pub fn anytuple_type(_: Global<'base>) -> Self[src]

The type Tuple.

pub fn tuple_type(_: Global<'base>) -> Self[src]

The type Tuple.

pub fn emptytuple_type(_: Global<'base>) -> Self[src]

The type of an empty tuple.

pub fn function_type(_: Global<'base>) -> Self[src]

The type Function.

pub fn builtin_type(_: Global<'base>) -> Self[src]

The type Builtin.

pub fn method_instance_type(_: Global<'base>) -> Self[src]

The type MethodInstance.

pub fn code_instance_type(_: Global<'base>) -> Self[src]

The type CodeInstance.

pub fn code_info_type(_: Global<'base>) -> Self[src]

The type CodeInfo.

pub fn method_type(_: Global<'base>) -> Self[src]

The type Method.

pub fn module_type(_: Global<'base>) -> Self[src]

The type Module.

pub fn weakref_type(_: Global<'base>) -> Self[src]

The type WeakRef.

pub fn abstractstring_type(_: Global<'base>) -> Self[src]

The type AbstractString.

pub fn string_type(_: Global<'base>) -> Self[src]

The type String.

pub fn errorexception_type(_: Global<'base>) -> Self[src]

The type ErrorException.

pub fn argumenterror_type(_: Global<'base>) -> Self[src]

The type ArgumentError.

pub fn loaderror_type(_: Global<'base>) -> Self[src]

The type LoadError.

pub fn initerror_type(_: Global<'base>) -> Self[src]

The type InitError.

pub fn typeerror_type(_: Global<'base>) -> Self[src]

The type TypeError.

pub fn methoderror_type(_: Global<'base>) -> Self[src]

The type MethodError.

pub fn undefvarerror_type(_: Global<'base>) -> Self[src]

The type UndefVarError.

pub fn lineinfonode_type(_: Global<'base>) -> Self[src]

The type LineInfoNode.

pub fn boundserror_type(_: Global<'base>) -> Self[src]

The type BoundsError.

pub fn bool_type(_: Global<'base>) -> Self[src]

The type Bool.

pub fn char_type(_: Global<'base>) -> Self[src]

The type Char.

pub fn int8_type(_: Global<'base>) -> Self[src]

The type Int8.

pub fn uint8_type(_: Global<'base>) -> Self[src]

The type UInt8.

pub fn int16_type(_: Global<'base>) -> Self[src]

The type Int16.

pub fn uint16_type(_: Global<'base>) -> Self[src]

The type UInt16.

pub fn int32_type(_: Global<'base>) -> Self[src]

The type Int32.

pub fn uint32_type(_: Global<'base>) -> Self[src]

The type UInt32.

pub fn int64_type(_: Global<'base>) -> Self[src]

The type Int64.

pub fn uint64_type(_: Global<'base>) -> Self[src]

The type UInt64.

pub fn float16_type(_: Global<'base>) -> Self[src]

The type Float16.

pub fn float32_type(_: Global<'base>) -> Self[src]

The type Float32.

pub fn float64_type(_: Global<'base>) -> Self[src]

The type Float64.

pub fn floatingpoint_type(_: Global<'base>) -> Self[src]

The type AbstractFloat.

pub fn number_type(_: Global<'base>) -> Self[src]

The type Number.

pub fn nothing_type(_: Global<'base>) -> Self[src]

The type Nothing.

pub fn signed_type(_: Global<'base>) -> Self[src]

The type Signed.

pub fn voidpointer_type(_: Global<'base>) -> Self[src]

The type Ptr{Nothing}.

pub fn task_type(_: Global<'base>) -> Self[src]

The type Task.

pub fn expr_type(_: Global<'base>) -> Self[src]

The type Expr.

pub fn globalref_type(_: Global<'base>) -> Self[src]

The type GlobalRef.

pub fn linenumbernode_type(_: Global<'base>) -> Self[src]

The type LineNumberNode.

pub fn gotonode_type(_: Global<'base>) -> Self[src]

The type GotoNode.

pub fn phinode_type(_: Global<'base>) -> Self[src]

The type PhiNode.

pub fn pinode_type(_: Global<'base>) -> Self[src]

The type PiNode.

pub fn phicnode_type(_: Global<'base>) -> Self[src]

The type PhiCNode.

pub fn upsilonnode_type(_: Global<'base>) -> Self[src]

The type UpsilonNode.

pub fn quotenode_type(_: Global<'base>) -> Self[src]

The type QuoteNode.

pub fn newvarnode_type(_: Global<'base>) -> Self[src]

The type NewVarNode.

pub fn intrinsic_type(_: Global<'base>) -> Self[src]

The type Intrinsic.

pub fn methtable_type(_: Global<'base>) -> Self[src]

The type MethodTable.

pub fn typemap_level_type(_: Global<'base>) -> Self[src]

The type TypeMapLevel.

pub fn typemap_entry_type(_: Global<'base>) -> Self[src]

The type TypeMapEntry.

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, 'data> Debug for DataType<'frame>[src]

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

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

impl<'frame> Into<Value<'frame, 'static>> for DataType<'frame>[src]

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

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

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

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

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

impl<'frame> ValidLayout 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.