BinaryFuncImpl

Struct BinaryFuncImpl 

Source
pub struct BinaryFuncImpl {
    pub elem_type: TypeId,
    pub f: Box<dyn BinaryArrayOperator>,
}
Expand description

Wrapper around a BinaryArrayOperator to conveniently lift it to a FuncImpl given the TypeId of the argument/return type.

Fields§

§elem_type: TypeId§f: Box<dyn BinaryArrayOperator>

Trait Implementations§

Source§

impl FuncImpl for BinaryFuncImpl

Source§

fn evaluate( &self, _state: &mut InterpreterState<'_>, args: Vec<TermReference>, ) -> (TermReference, NewlyEvaluatedTerms)

Given a handle on the current InterpreterState (primarily useful if additional terms need to be evaluated / looked up) and the collection of TermReference arguments to apply this function implementation to, yields a TermReference to the result, along with a collection of any NewlyEvaluatedTerms which may have arisen as part of the implementation of this method. See func_impl.rs in the source for sample implementations.
Source§

impl HasFuncSignature for BinaryFuncImpl

Source§

fn get_name(&self) -> String

Gets the name for the implemented function.
Source§

fn required_arg_types(&self) -> Vec<TypeId>

Gets the list of required argument types for the implemented function.
Source§

fn ret_type(&self) -> TypeId

Gets the return type for the implemented function.
Source§

fn ready_to_evaluate(&self, args: &Vec<TermReference>) -> bool

Given a collection of TermReferences, determines whether we have sufficiently-many arguments to fully evaluate this function.
Source§

fn func_type(&self, type_info_directory: &TypeInfoDirectory) -> TypeId

Given a TypeInfoDirectory, obtains the TypeId which corresponds to the type of this implemented function.

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> 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, 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V