pub enum Type {
Bool,
Int(IntTy),
UInt(UIntTy),
Float(FloatTy),
Fixed(FixedTy),
UFixed(FixedTy),
String,
Bytes,
Tuple(Vec<Type>),
Option(Box<Type>),
Function {
args: Vec<Type>,
ret: Box<Type>,
},
}
Expand description
Represents an RTLola value type. This does not including pacing information, for this refer to TimeDrivenStream and EventDrivenStream.
Variants§
Bool
A boolean type
Int(IntTy)
An integer type of fixed bit-width
UInt(UIntTy)
An unsigned integer type of fixed bit-width
Float(FloatTy)
A floating point type of fixed bit-width
Fixed(FixedTy)
A signed fixed point type of fixed bit-width
UFixed(FixedTy)
An unsigned fixed point type of fixed bit-width
String
A unicode string
Bytes
A sequence of 8-bit bytes
Tuple(Vec<Type>)
An n-ary tuples where n is the length of the contained vector
Option(Box<Type>)
An optional value type, e.g., resulting from accessing a past value of a stream
Function
A type describing a function
Implementations§
Source§impl Type
impl Type
Sourcepub fn size(&self) -> Option<ValSize>
pub fn size(&self) -> Option<ValSize>
Indicates how many bytes a type requires to be stored in memory.
Recursive types yield the sum of their sub-type sizes, unsized types panic, and functions do not have a size, so they produce None
.
§Panics
Panics if the type is an instance of Type::Option, Type::String, or Type::Bytes because their size is undetermined.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
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>,
Source§impl From<ConcreteValueType> for Type
impl From<ConcreteValueType> for Type
Source§fn from(ty: ConcreteValueType) -> Type
fn from(ty: ConcreteValueType) -> Type
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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§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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more