pub struct LeanDemo { /* private fields */ }Expand description
Demo struct showing hash-consing performance in WASM
Implementations§
Source§impl LeanDemo
impl LeanDemo
Sourcepub fn create_variable(&mut self, index: u32) -> bool
pub fn create_variable(&mut self, index: u32) -> bool
Demonstrate hash-consing: creating same term twice reuses memory Returns true if successful
Sourcepub fn demonstrate_hash_consing(&mut self) -> bool
pub fn demonstrate_hash_consing(&mut self) -> bool
Create two identical variables and verify they share the same ID Returns true if hash-consing worked (same IDs)
Sourcepub fn create_type(&mut self) -> bool
pub fn create_type(&mut self) -> bool
Create a simple type (Type universe)
Sourcepub fn create_identity_function(&mut self) -> bool
pub fn create_identity_function(&mut self) -> bool
Create a lambda abstraction (x : Type) => x
Sourcepub fn benchmark_equality(&mut self) -> String
pub fn benchmark_equality(&mut self) -> String
Verify that hash-consing provides O(1) equality
Trait Implementations§
Source§impl FromWasmAbi for LeanDemo
impl FromWasmAbi for LeanDemo
Source§impl IntoWasmAbi for LeanDemo
impl IntoWasmAbi for LeanDemo
Source§impl LongRefFromWasmAbi for LeanDemo
impl LongRefFromWasmAbi for LeanDemo
Source§impl OptionFromWasmAbi for LeanDemo
impl OptionFromWasmAbi for LeanDemo
Source§impl OptionIntoWasmAbi for LeanDemo
impl OptionIntoWasmAbi for LeanDemo
Source§impl RefFromWasmAbi for LeanDemo
impl RefFromWasmAbi for LeanDemo
Source§impl RefMutFromWasmAbi for LeanDemo
impl RefMutFromWasmAbi for LeanDemo
Source§impl TryFromJsValue for LeanDemo
impl TryFromJsValue for LeanDemo
Source§impl VectorFromWasmAbi for LeanDemo
impl VectorFromWasmAbi for LeanDemo
Source§impl VectorIntoWasmAbi for LeanDemo
impl VectorIntoWasmAbi for LeanDemo
impl SupportsConstructor for LeanDemo
impl SupportsInstanceProperty for LeanDemo
impl SupportsStaticProperty for LeanDemo
Auto Trait Implementations§
impl !Freeze for LeanDemo
impl RefUnwindSafe for LeanDemo
impl Send for LeanDemo
impl Sync for LeanDemo
impl Unpin for LeanDemo
impl UnwindSafe for LeanDemo
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.