pub struct Type {
pub name: Symbol,
pub vtable: TypeVtable,
}Expand description
A Muse type definition.
Fields§
§name: SymbolThe name of the type.
vtable: TypeVtableThe virtual function table.
Implementations§
source§impl Type
impl Type
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_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) -> Selfwhere
Func: Fn(&AnyDynamic, ContextOrGuard<'_, '_, '_>, &Value) -> Result<bool, Fault> + Send + Sync + 'static,
pub fn with_eq<Func>(self, func: impl FnOnce(EqFn) -> Func) -> Selfwhere
Func: Fn(&AnyDynamic, ContextOrGuard<'_, '_, '_>, &Value) -> Result<bool, Fault> + Send + Sync + 'static,
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_fallback<Mapping>(self, mapping: Mapping) -> Self
pub fn with_fallback<Mapping>(self, mapping: Mapping) -> Self
Replaces all functions on this table by invoking mapping and invoking
the corresponding functionality on the returned value.