Struct FunctionT

Source
pub struct FunctionT(pub Result<Arc<dyn Fn(&Type, &CheckInfo) -> Result<Type, CheckError> + Send + Sync>, Arc<Vec<(Type, Type)>>>, pub CheckInfo);

Tuple Fields§

§0: Result<Arc<dyn Fn(&Type, &CheckInfo) -> Result<Type, CheckError> + Send + Sync>, Arc<Vec<(Type, Type)>>>§1: CheckInfo

Implementations§

Source§

impl FunctionT

Source

pub fn o(&self, i: &Type) -> Result<Type, CheckError>

get output type

Trait Implementations§

Source§

impl Clone for FunctionT

Source§

fn clone(&self) -> FunctionT

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FunctionT

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl MersType for FunctionT

Source§

fn display(&self, info: &DisplayInfo<'_>, f: &mut Formatter<'_>) -> Result

Source§

fn executable(&self) -> Option<FunctionT>

Source§

fn iterable(&self) -> Option<Type>

If Some(T), calling iterable on the MersData this MersType belongs to Should return Some(I), where I is an Iterator which only returns items of type T.
Source§

fn is_same_type_as(&self, other: &dyn MersType) -> bool

If self and other are different types (other.as_any().downcast_ref::<Self>().is_none()), this must return false.
Source§

fn is_included_in(&self, target: &dyn MersType) -> bool

This doesn’t handle the case where target is Type (Type::is_included_in handles it)
Source§

fn subtypes(&self, acc: &mut Type)

Returns all types that can result from the use of this type. Usually, this is just acc.add(Arc::new(self.clone())) but if there exists one or more inner types, this becomes interesting: Using (int/string) will end up being either (int) or (string), so this function should add (int) and (string). Since (int/string) can’t exist at runtime, we don’t need to list self. note also: subtypes has to be called recursively, i.e. you would have to call .substring on int and string.
Source§

fn as_any(&self) -> &dyn Any

Source§

fn mut_any(&mut self) -> &mut dyn Any

Source§

fn to_any(self) -> Box<dyn Any>

Source§

fn get(&self) -> Option<Type>

If Some(T), calling get on data of this type may return T, but it might also return None. By default, this returns the same thing as iterable, since this is also the default implementation for MersData::get.
Source§

fn subtypes_type(&self) -> Type

like subtypes, but returns the accumulator
Source§

fn is_reference_to(&self) -> Option<&Type>

Source§

fn simplify_for_display(&self, info: &CheckInfo) -> Option<Type>

may mutate self to simplify it
Source§

fn simplified_as_string(&self, info: &CheckInfo) -> String

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MersTypeWInfo for T
where T: MersType + ?Sized,

Source§

fn with_display<'a>( &'a self, info: &DisplayInfo<'a>, ) -> MersTypeWithInfo<'a, Self>

Source§

fn with_info<'a>( &'a self, info: &'a Info<impl Local>, ) -> MersTypeWithInfo<'a, Self>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.