pub enum DataType {
Any,
Void,
Boolean,
Integer,
Real,
String,
Semver,
Array(Box<DataType>),
Function(Box<FunctionSignature>),
Class(String),
}
Expand description
Defines the datatypes in the BraneScript/Bakery AST.
Variants§
Any
The ‘Any’ type basically means ‘resolve at runtime’.
Void
The ‘Void’ type basically means ‘no type / value’.
Boolean
Boolean values (i.e., true or false, 1 or 0, yes or no, etc).
Integer
Integral values (i.e., non-decimal numbers)
Real
Real values (i.e., decimal numbers)
String
String values (i.e., arrays of characters)
Semver
Semantic versioning (i.e., major.minor.patch)
Array(Box<DataType>)
Arrays (i.e., a memory area divided into homogeneous types)
Function(Box<FunctionSignature>)
Functions (i.e., executable pieces of code)
Class(String)
Classes (i.e., a memory area divided into heterogeneous types)
Implementations§
source§impl DataType
impl DataType
sourcepub fn coercible_to<D: AsRef<DataType>>(&self, other: D) -> bool
pub fn coercible_to<D: AsRef<DataType>>(&self, other: D) -> bool
sourcepub fn coercible_to_function(&self) -> bool
pub fn coercible_to_function(&self) -> bool
Returns whether or not this DataType may be implicitly converted to a function at all (of any signature).
To determine if the DataType is implicitly convertible to a function of a specific signature, use DataType::coercible_to()
.
§Returns
True if it is convertible, false otherwise.
Trait Implementations§
source§impl<'de> Deserialize<'de> for DataType
impl<'de> Deserialize<'de> for DataType
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request