pub trait ClassicalSystem {
// Required method
fn radices(&self) -> Radices;
// Provided methods
fn num_dits(&self) -> usize { ... }
fn dimension(&self) -> usize { ... }
fn is_bit_only(&self) -> bool { ... }
fn is_trit_only(&self) -> bool { ... }
fn is_dit_only<T: Into<Radix>>(&self, radix: T) -> bool { ... }
fn is_homogenous(&self) -> bool { ... }
}Expand description
A data structure consisting of or operating on a specified number of dits.
Required Methods§
Provided Methods§
Sourcefn num_dits(&self) -> usize
fn num_dits(&self) -> usize
Returns the number of classical bits in the system.
§Returns
A usize representing the number of classical bits.
Sourcefn dimension(&self) -> usize
fn dimension(&self) -> usize
Returns the total dimension of the classical system.
§Returns
A usize representing the product of the radices of all dits.
Sourcefn is_bit_only(&self) -> bool
fn is_bit_only(&self) -> bool
Checks if the system consists only of bits (2-level systems).
§Returns
true if all dits are bits, otherwise false.
Sourcefn is_trit_only(&self) -> bool
fn is_trit_only(&self) -> bool
Checks if the system consists only of trits (3-level systems).
§Returns
true if all dits are trits, otherwise false.
Sourcefn is_dit_only<T: Into<Radix>>(&self, radix: T) -> bool
fn is_dit_only<T: Into<Radix>>(&self, radix: T) -> bool
Sourcefn is_homogenous(&self) -> bool
fn is_homogenous(&self) -> bool
Checks if the system is homogenous, i.e., all dits have the same radix.
§Returns
true if the system is homogenous, otherwise false.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.