[−][src]Enum dyon::Type
Stores a Dyon type.
Variants
Whether a statement is never reached.
A no-type.
Any type.
Boolean type.
F64 type.
4D vector type.
4D matrix type.
String/text type.
Link type.
Array type.
Object type.
Option type.
Result type.
Secret type.
Thread handle type.
In-type.
Ad-hoc type.
Closure type.
Implementations
impl Type
[src]
pub fn all_ext(
args: Vec<Type>,
ret: Type
) -> (Vec<Arc<String>>, Vec<Type>, Type)
[src]
args: Vec<Type>,
ret: Type
) -> (Vec<Arc<String>>, Vec<Type>, Type)
Returns an extension quantified over ad-hoc types.
For example, (vec4, vec4) -> vec4
becomes all T { (T vec4, T vec4) -> T vec4 }
.
pub fn description(&self) -> String
[src]
Returns description of the type.
pub fn array() -> Type
[src]
Returns an array type with an any
as inner type.
pub fn object() -> Type
[src]
Returns an object type.
pub fn option() -> Type
[src]
Returns an Option type with an any
as inner type.
pub fn result() -> Type
[src]
Returns a Result type with an any
as inner type.
pub fn thread() -> Type
[src]
Returns a thread handle type with an any
as inner type.
pub fn in_ty() -> Type
[src]
Returns an in-type with an any
as inner type.
pub fn bind_ty_vars(
&self,
refine: &Type,
names: &[Arc<String>],
ty_vars: &mut Vec<Option<Arc<String>>>
) -> Result<Type, String>
[src]
&self,
refine: &Type,
names: &[Arc<String>],
ty_vars: &mut Vec<Option<Arc<String>>>
) -> Result<Type, String>
Binds refinement type variables.
Returns the type argument to compare to.
pub fn insert_var(&mut self, name: &Arc<String>, val: &Arc<String>)
[src]
Inserts variable name, replacing ad-hoc type name.
pub fn insert_none_var(&mut self, name: &Arc<String>)
[src]
Inserts a none ad-hoc variable.
pub fn ambiguous(&self, refine: &Type) -> bool
[src]
Returns true
if a type to be refined is ambiguous relative to this type (directional check).
For example, the type ad-hoc type Foo str
is ambiguous with type str
.
If more was known about the str
type with further refinement,
then it might turn out to be Bar str
, which triggers a collision.
pub fn closure_ret_ty(&self) -> Option<Type>
[src]
Returns true
if the type can be a closure, false
otherwise.
pub fn goes_with(&self, other: &Type) -> bool
[src]
Returns true
if a type goes with another type (directional check).
bool
(argument) goes withsec[bool]
(value)f64
(argument) goes withsec[f64]
(value)
The opposite is not true, since sec
contains extra information.
pub fn add_assign(&self, other: &Type) -> bool
[src]
Infers type from the +=
operator.
pub fn from_meta_data(
node: &str,
convert: Convert,
ignored: &mut Vec<Range>
) -> Result<(Range, Type), ()>
[src]
node: &str,
convert: Convert,
ignored: &mut Vec<Range>
) -> Result<(Range, Type), ()>
Converts meta data into a type.
Trait Implementations
impl Clone for Type
[src]
impl Debug for Type
[src]
impl PartialEq<Type> for Type
[src]
impl StructuralPartialEq for Type
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl !UnwindSafe for Type
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,