Struct muse_lang::runtime::value::RustTypeBuilder
source · pub struct RustTypeBuilder<T> { /* private fields */ }Expand description
A builder for a RustType<T>.
Implementations§
source§impl<T> RustTypeBuilder<T>where
T: CustomType + Trace,
impl<T> RustTypeBuilder<T>where
T: CustomType + Trace,
sourcepub fn with_construct<Func>(
self,
func: impl FnOnce(ConstructFn) -> Func,
) -> Self
pub fn with_construct<Func>( self, func: impl FnOnce(ConstructFn) -> Func, ) -> Self
Replaces the constructor with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_call<Func>(self, func: impl FnOnce(CallFn) -> Func) -> Self
pub fn with_call<Func>(self, func: impl FnOnce(CallFn) -> Func) -> Self
Replaces the call handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_function_table(self, functions: RustFunctionTable<T>) -> Self
pub fn with_function_table(self, functions: RustFunctionTable<T>) -> Self
Replaces the invoke handler with a handler that invokes the appropriate function.
sourcepub fn with_invoke<Func>(self, func: impl FnOnce(InvokeFn) -> Func) -> Self
pub fn with_invoke<Func>(self, func: impl FnOnce(InvokeFn) -> Func) -> Self
Replaces the invoke handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_hash<Func>(self, func: impl FnOnce(HashFn) -> Func) -> Self
pub fn with_hash<Func>(self, func: impl FnOnce(HashFn) -> Func) -> Self
Replaces the hash handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_bitwise_not<Func>(self, func: impl FnOnce(UnaryFn) -> Func) -> Self
pub fn with_bitwise_not<Func>(self, func: impl FnOnce(UnaryFn) -> Func) -> Self
Replaces the bitwise not handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_bitwise_and<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_bitwise_and<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the bitwise and with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_bitwise_or<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_bitwise_or<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the bitwise or handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_bitwise_xor<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_bitwise_xor<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the bitwise xor handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_shift_left<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_shift_left<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the shift left handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_shift_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_shift_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the shift right handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_negate<Func>(self, func: impl FnOnce(UnaryFn) -> Func) -> Self
pub fn with_negate<Func>(self, func: impl FnOnce(UnaryFn) -> Func) -> Self
Replaces the negate handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_eq<Func>(self, func: impl FnOnce(EqFn) -> Func) -> Self
pub fn with_eq<Func>(self, func: impl FnOnce(EqFn) -> Func) -> Self
Replaces the eq handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_matches<Func>(self, func: impl FnOnce(MatchesFn) -> Func) -> Self
pub fn with_matches<Func>(self, func: impl FnOnce(MatchesFn) -> Func) -> Self
Replaces the matches handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_total_cmp<Func>(self, func: impl FnOnce(TotalCmpFn) -> Func) -> Self
pub fn with_total_cmp<Func>(self, func: impl FnOnce(TotalCmpFn) -> Func) -> Self
Replaces the comparison handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_add<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_add<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the add handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_add_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_add_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the add-right handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_sub<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_sub<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the sub handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_sub_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_sub_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the sub-right handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_mul<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_mul<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the mul handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_mul_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_mul_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the mul-right handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_div<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_div<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the div handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_div_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_div_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the div-right handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_idiv<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_idiv<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the idiv handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_idiv_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_idiv_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the idiv-right handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_rem<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_rem<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the rem handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_rem_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
pub fn with_rem_right<Func>(self, func: impl FnOnce(BinaryFn) -> Func) -> Self
Replaces the rem-right handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_truthy<Func>(self, func: impl FnOnce(TruthyFn) -> Func) -> Self
pub fn with_truthy<Func>(self, func: impl FnOnce(TruthyFn) -> Func) -> Self
Replaces the truthy handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_to_string<Func>(self, func: impl FnOnce(ToStringFn) -> Func) -> Self
pub fn with_to_string<Func>(self, func: impl FnOnce(ToStringFn) -> Func) -> Self
Replaces the to_string handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_deep_clone<Func>(
self,
func: impl FnOnce(DeepCloneFn) -> Func,
) -> Self
pub fn with_deep_clone<Func>( self, func: impl FnOnce(DeepCloneFn) -> Func, ) -> Self
Replaces the deep_clone handler with func.
func is a function that returns the actual handler function. It takes
a single parameter: the existing handler. This design allows for
functions to be overridden while still falling back to the previous
implementation.
sourcepub fn with_clone(self) -> Selfwhere
T: Clone,
pub fn with_clone(self) -> Selfwhere
T: Clone,
Replaces the deep_clone handler with an implementation that uses
Clone.