pub struct ScalarDomainSpec {
pub domain: Symbol,
pub numeric_family: &'static str,
pub canonical_form: &'static str,
pub parse_priority: i32,
}Expand description
Static identity of a scalar number domain (data only).
A concrete domain crate fills this in once and derives its stable literal-class and instance-shape symbols from it, rather than spelling them out by hand.
§Examples
use sim_lib_numbers_core::{ScalarDomainSpec, domains};
let spec = ScalarDomainSpec {
domain: domains::i64(),
numeric_family: "integer",
canonical_form: "i64",
parse_priority: 20,
};
assert_eq!(spec.literal_class_symbol(), domains::literal_class("i64"));Fields§
§domain: SymbolThe domain symbol, e.g. numbers/i64.
numeric_family: &'static strThe numeric family label, e.g. "integer".
canonical_form: &'static strThe canonical form label, e.g. "i64".
parse_priority: i32The literal parse priority.
Implementations§
Source§impl ScalarDomainSpec
impl ScalarDomainSpec
Sourcepub fn matcher(&self) -> DomainLiteralMatcher
pub fn matcher(&self) -> DomainLiteralMatcher
A literal matcher for this domain.
Sourcepub fn literal_class_symbol(&self) -> Symbol
pub fn literal_class_symbol(&self) -> Symbol
The literal class symbol, e.g. numbers/i64-literal.
Sourcepub fn literal_instance_shape_symbol(&self) -> Symbol
pub fn literal_instance_shape_symbol(&self) -> Symbol
The literal instance-shape symbol, e.g. numbers/i64-literal/instance-shape.
Auto Trait Implementations§
impl Freeze for ScalarDomainSpec
impl RefUnwindSafe for ScalarDomainSpec
impl Send for ScalarDomainSpec
impl Sync for ScalarDomainSpec
impl Unpin for ScalarDomainSpec
impl UnsafeUnpin for ScalarDomainSpec
impl UnwindSafe for ScalarDomainSpec
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