pub struct Scale {
pub name: String,
pub residues: ResidueType,
pub much_smaller_than: Option<Arc<Scale>>,
pub much_larger_than: Option<Arc<Scale>>,
pub refines: Option<Arc<Scale>>,
}Expand description
An infinitesimal of the program: the name it was declared under, what is known about the
residues of its reciprocal, the infinite natural ⌈1/dt⌉, and where it stands among the others.
dx declared much smaller than dt is smaller than every positive number made from dt, so the
two are ordered as levels: every value of dx with coefficients made from dt has the sign of
its lowest-order coefficient in dx. A declaration names at most one infinitesimal it is much
smaller than and one it is much larger than, and the order of any two is what those statements
give by transitivity (Scale::order); two the declarations do not order are never combined.
Fields§
§name: String§residues: ResidueType§much_smaller_than: Option<Arc<Scale>>The infinitesimal this one was declared much smaller than.
much_larger_than: Option<Arc<Scale>>The infinitesimal this one was declared much larger than.
refines: Option<Arc<Scale>>The declared infinitesimal this is, read on one residue class of its reciprocal: the engine’s copy for a class keeps the declaration it refines, and is that infinitesimal.
Implementations§
Source§impl Scale
impl Scale
Sourcepub fn new(name: &str, residues: ResidueType) -> Scale
pub fn new(name: &str, residues: ResidueType) -> Scale
An infinitesimal declared on its own.
Sourcepub fn ordered(
name: &str,
residues: ResidueType,
larger: Option<Arc<Scale>>,
smaller: Option<Arc<Scale>>,
) -> Result<Scale, String>
pub fn ordered( name: &str, residues: ResidueType, larger: Option<Arc<Scale>>, smaller: Option<Arc<Scale>>, ) -> Result<Scale, String>
An infinitesimal declared much smaller than larger and much larger than smaller, each
when given; refused when the bounds are not already ordered, smaller below larger, or when it
would share a name with an infinitesimal it is ordered with.
Sourcepub fn with_residues(self: &Arc<Scale>, residues: ResidueType) -> Scale
pub fn with_residues(self: &Arc<Scale>, residues: ResidueType) -> Scale
The same infinitesimal on a narrower residue type of its reciprocal.
Sourcepub fn same_infinitesimal(&self, o: &Scale) -> bool
pub fn same_infinitesimal(&self, o: &Scale) -> bool
Whether the two are one infinitesimal: one declaration, whatever residue class either is read on.
Sourcepub fn order(&self, o: &Scale) -> Option<Ordering>
pub fn order(&self, o: &Scale) -> Option<Ordering>
Less when this infinitesimal is much smaller than o, Greater when much larger, Equal
for one infinitesimal; None when the declarations do not order them. a is much smaller than
b when some infinitesimal reached from a through the ones declared above it is reached
from b through the ones declared below it: every declaration states its bounds’ order
already known, so no later one orders two earlier ones, and that meeting is the only route.
Sourcepub fn unordered(&self, o: &Scale) -> String
pub fn unordered(&self, o: &Scale) -> String
The refusal for two infinitesimals whose order the program does not state.
Sourcepub fn generator_text(&self) -> String
pub fn generator_text(&self) -> String
How the infinite generator is written in a dependence: ⌈1/dt⌉.
Source§impl Scale
impl Scale
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
The declaration’s canonical bytes: the residue type of the reciprocal, and for an infinitesimal
declared much smaller or much larger than another, a 1 and each of those two in turn — a 0
for none, or a 1, its name and its own bytes. An infinitesimal declared on its own writes its
residue type alone. A residue class’s copy writes the declaration it refines.
Sourcepub fn from_bytes(name: &str, bytes: &[u8]) -> Option<Arc<Scale>>
pub fn from_bytes(name: &str, bytes: &[u8]) -> Option<Arc<Scale>>
The infinitesimal Scale::to_bytes wrote under name; None for a forged or non-canonical
encoding, or a declaration its bounds refuse.
Trait Implementations§
impl Eq for Scale
impl StructuralPartialEq for Scale
Auto Trait Implementations§
impl Freeze for Scale
impl RefUnwindSafe for Scale
impl Send for Scale
impl Sync for Scale
impl Unpin for Scale
impl UnsafeUnpin for Scale
impl UnwindSafe for Scale
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.