Trait nominals::DigitCollection
source · pub trait DigitCollection {
type Fallback: DigitCollection + Default;
// Required methods
fn has_zero_digit(&self) -> bool;
fn len(&self) -> usize;
fn digit(&self, index: usize) -> char;
// Provided methods
fn fixed(&self) -> bool { ... }
fn zero_based(&self) -> bool { ... }
fn is_empty(&self) -> bool { ... }
fn and<Other>(self, other: Other) -> Chain<Self, Other>
where Self: Sized,
Other: DigitCollection { ... }
fn one_based(self) -> OneBased<Self>
where Self: Sized { ... }
}
Expand description
An ordered collection of digits that can be used as a NominalSystem
.
Required Associated Types§
sourcetype Fallback: DigitCollection + Default
type Fallback: DigitCollection + Default
The digit collection that should be used after this collection’s range is exhausted.
Required Methods§
sourcefn has_zero_digit(&self) -> bool
fn has_zero_digit(&self) -> bool
Returns true if this collection has a symbol representing 0
at index
0.
Provided Methods§
sourcefn zero_based(&self) -> bool
fn zero_based(&self) -> bool
Returns true if this collection should start counting at 1 instead of 0.
This function is only called if has_zero_digit()
returns false.
sourcefn and<Other>(self, other: Other) -> Chain<Self, Other>where
Self: Sized,
Other: DigitCollection,
fn and<Other>(self, other: Other) -> Chain<Self, Other>where
Self: Sized,
Other: DigitCollection,
Chains self
and other
into a single DigitCollection
.