pub struct Reading {
pub lines: [Line; 6],
pub question: Option<String>,
}Fields§
§lines: [Line; 6]§question: Option<String>Implementations§
Source§impl Reading
impl Reading
pub fn new(lines: [Line; 6], question: Option<String>) -> Self
Sourcepub fn primary_hexagram(&self) -> u8
pub fn primary_hexagram(&self) -> u8
Generate primary hexagram number (1-64)
Sourcepub fn upper_trigram(&self) -> [Polarity; 3]
pub fn upper_trigram(&self) -> [Polarity; 3]
Get upper trigram (lines 4, 5, 6 - positions 3, 4, 5 in array)
Sourcepub fn lower_trigram(&self) -> [Polarity; 3]
pub fn lower_trigram(&self) -> [Polarity; 3]
Get lower trigram (lines 1, 2, 3 - positions 0, 1, 2 in array)
Sourcepub fn has_changing_lines(&self) -> bool
pub fn has_changing_lines(&self) -> bool
Check if there are changing lines
Sourcepub fn changing_line_positions(&self) -> Vec<u8> ⓘ
pub fn changing_line_positions(&self) -> Vec<u8> ⓘ
Get positions of changing lines (1-indexed, traditional bottom-to-top)
Sourcepub fn transformed_hexagram(&self) -> Option<Reading>
pub fn transformed_hexagram(&self) -> Option<Reading>
Generate the transformed hexagram (if any changing lines exist)
Sourcepub fn traditional_numbers(&self) -> [u8; 6]
pub fn traditional_numbers(&self) -> [u8; 6]
Get traditional numbers for all lines
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reading
impl<'de> Deserialize<'de> for Reading
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Reading
impl RefUnwindSafe for Reading
impl Send for Reading
impl Sync for Reading
impl Unpin for Reading
impl UnsafeUnpin for Reading
impl UnwindSafe for Reading
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