pub struct PromotionRule {
pub from_domain: Symbol,
pub to_domain: Symbol,
pub cost: u16,
pub convert: fn(&mut Cx, NumberLiteral) -> Result<NumberLiteral>,
}Expand description
A literal-level conversion edge from one number domain to another.
Fields§
§from_domain: SymbolDomain the rule converts from.
to_domain: SymbolDomain the rule converts to.
cost: u16Relative cost, used to rank competing promotion paths.
convert: fn(&mut Cx, NumberLiteral) -> Result<NumberLiteral>Converts a literal in from_domain to one in to_domain.
Trait Implementations§
Source§impl Clone for PromotionRule
impl Clone for PromotionRule
Source§fn clone(&self) -> PromotionRule
fn clone(&self) -> PromotionRule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PromotionRule
impl RefUnwindSafe for PromotionRule
impl Send for PromotionRule
impl Sync for PromotionRule
impl Unpin for PromotionRule
impl UnsafeUnpin for PromotionRule
impl UnwindSafe for PromotionRule
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