pub struct Ordinal { /* private fields */ }Expand description
An ordinal below ε₀. See the module documentation.
Implementations§
Source§impl Ordinal
impl Ordinal
pub fn zero() -> Ordinal
pub fn one() -> Ordinal
pub fn from_u64(n: u64) -> Ordinal
Sourcepub fn from_natural(n: BigInt) -> Ordinal
pub fn from_natural(n: BigInt) -> Ordinal
The finite ordinal n. Panics on a negative n.
pub fn omega() -> Ordinal
pub fn is_zero(&self) -> bool
pub fn is_finite(&self) -> bool
pub fn to_natural(&self) -> Option<BigInt>
Sourcepub fn is_successor(&self) -> bool
pub fn is_successor(&self) -> bool
Ends in a finite term: α = β + 1 for some β.
Sourcepub fn is_limit(&self) -> bool
pub fn is_limit(&self) -> bool
Nonzero and not a successor: the supremum of everything below it.
Sourcepub fn predecessor(&self) -> Option<Ordinal>
pub fn predecessor(&self) -> Option<Ordinal>
β with β + 1 = self, for a successor.
pub fn add(&self, o: &Ordinal) -> Ordinal
pub fn mul(&self, o: &Ordinal) -> Ordinal
Trait Implementations§
Source§impl ExactCodec for Ordinal
impl ExactCodec for Ordinal
Source§fn write(&self, out: &mut Vec<u8>)
fn write(&self, out: &mut Vec<u8>)
The Cantor normal form: the number of terms, then each exponent (recursively) and its coefficient.
fn read(buf: &[u8], pos: &mut usize) -> Option<Self>
fn to_bytes(&self) -> Vec<u8> ⓘ
Source§fn from_bytes(buf: &[u8]) -> Option<Self>
fn from_bytes(buf: &[u8]) -> Option<Self>
The value
buf canonically encodes, with nothing left over.Source§impl Ord for Ordinal
impl Ord for Ordinal
Source§impl PartialOrd for Ordinal
impl PartialOrd for Ordinal
impl Eq for Ordinal
impl StructuralPartialEq for Ordinal
Auto Trait Implementations§
impl Freeze for Ordinal
impl RefUnwindSafe for Ordinal
impl Send for Ordinal
impl Sync for Ordinal
impl Unpin for Ordinal
impl UnsafeUnpin for Ordinal
impl UnwindSafe for Ordinal
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