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>
impl<PT: ProtocolTypes> Signature<PT>
sourcepub fn new(definitions: Vec<FunctionDefinition<PT>>) -> Signature<PT>
pub fn new(definitions: Vec<FunctionDefinition<PT>>) -> Signature<PT>
Construct a Signature
from the given FunctionDefinition
s.
sourcepub fn new_function<F, Types>(f: &'static F) -> Function<PT>where
F: DescribableFunction<PT, Types> + 'static,
pub fn new_function<F, Types>(f: &'static F) -> Function<PT>where
F: DescribableFunction<PT, Types> + 'static,
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>,
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§
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> 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
Mutably borrows from an owned value. Read more
§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
The Resulting [
TupleList
], of an [Prepend::prepend()
] call,
including the prepended entry.