pub struct EncodedGame {
pub inner: Vec<u64>,
pub bit_index: usize,
}Expand description
Representation of an encoded chess game.
Fields§
§inner: Vec<u64>§bit_index: usizeImplementations§
Source§impl EncodedGame
impl EncodedGame
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Convert the encoded chess game to a byte vector. Use from_bytes to convert the result back to an EncodedGame.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, EncodedGameConstructionError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, EncodedGameConstructionError>
Convert a byte vector (that was the output of to_bytes) to an EncodedGame.
The result being Ok does not guarantee that the encoded game is a valid chess game,
only that the byte vector could be parsed into an EncodedGame.
Trait Implementations§
Source§impl Clone for EncodedGame
impl Clone for EncodedGame
Source§fn clone(&self) -> EncodedGame
fn clone(&self) -> EncodedGame
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncodedGame
impl Debug for EncodedGame
Source§impl Hash for EncodedGame
impl Hash for EncodedGame
Source§impl PartialEq for EncodedGame
impl PartialEq for EncodedGame
impl Eq for EncodedGame
impl StructuralPartialEq for EncodedGame
Auto Trait Implementations§
impl Freeze for EncodedGame
impl RefUnwindSafe for EncodedGame
impl Send for EncodedGame
impl Sync for EncodedGame
impl Unpin for EncodedGame
impl UnwindSafe for EncodedGame
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