Struct puffin::algebra::signature::Signature

source ·
pub struct Signature<PT: ProtocolTypes> {
    pub functions_by_name: HashMap<&'static str, FunctionDefinition<PT>>,
    pub functions_by_typ: HashMap<TypeShape<PT>, Vec<FunctionDefinition<PT>>>,
    pub functions: Vec<FunctionDefinition<PT>>,
    pub types_by_name: HashMap<&'static str, TypeShape<PT>>,
}
Expand description

Records a universe of functions. Signatures are containers for types and function symbols. They hold references to the concrete implementations of functions and the types of variables.

Fields§

§functions_by_name: HashMap<&'static str, FunctionDefinition<PT>>§functions_by_typ: HashMap<TypeShape<PT>, Vec<FunctionDefinition<PT>>>§functions: Vec<FunctionDefinition<PT>>§types_by_name: HashMap<&'static str, TypeShape<PT>>

Implementations§

source§

impl<PT: ProtocolTypes> Signature<PT>

source

pub fn new(definitions: Vec<FunctionDefinition<PT>>) -> Signature<PT>

Construct a Signature from the given FunctionDefinitions.

source

pub fn new_function<F, Types>(f: &'static F) -> Function<PT>
where F: DescribableFunction<PT, Types> + 'static,

Create a new Function distinct from all existing Functions.

source

pub fn new_var_with_type<T: 'static, M: Matcher>( source: Option<Source>, matcher: Option<M>, counter: u16, ) -> Variable<PT>
where PT: ProtocolTypes<Matcher = M>,

source

pub fn new_var<M: Matcher>( type_shape: TypeShape<PT>, source: Option<Source>, matcher: Option<M>, counter: u16, ) -> Variable<PT>
where PT: ProtocolTypes<Matcher = M>,

Trait Implementations§

source§

impl<PT: ProtocolTypes> Debug for Signature<PT>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<PT> Freeze for Signature<PT>

§

impl<PT> !RefUnwindSafe for Signature<PT>

§

impl<PT> Send for Signature<PT>
where PT: Send,

§

impl<PT> Sync for Signature<PT>
where PT: Sync,

§

impl<PT> Unpin for Signature<PT>
where PT: Unpin,

§

impl<PT> !UnwindSafe for Signature<PT>

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> AsAny for T
where T: 'static,

source§

fn as_any(&self) -> &(dyn Any + 'static)

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.

§

impl<Tail, T> Prepend<T> for Tail

§

type PreprendResult = Tail

The Resulting [TupleList], of an [Prepend::prepend()] call, including the prepended entry.
§

fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)

Prepend a value to this tuple, returning a new tuple with prepended value.
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.
§

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

§

fn vzip(self) -> V

§

impl<T> DebugAny for T
where T: Any + Debug,

§

impl<T> MaybeHasScalabilityMonitor for T

§

impl<T> UnsafeAny for T
where T: Any,