pub struct RustyLink { /* private fields */ }Implementations§
Source§impl RustyLink
A connection to a chessboard device
supports enabling/disabling LEDs, beeping and fetching FEN data from the board
impl RustyLink
A connection to a chessboard device supports enabling/disabling LEDs, beeping and fetching FEN data from the board
pub fn connect(vendor_id: u16, product_id: u16) -> Result<RustyLink, RlnError>
Sourcepub fn default_mode(&mut self) -> Result<(), RlnError>
pub fn default_mode(&mut self) -> Result<(), RlnError>
Sets the board in default mode, which is the mode the board starts in. In this mode, the FEN is not read, but you can still interact with the board
Sourcepub fn real_time_mode(&mut self) -> Result<(), RlnError>
pub fn real_time_mode(&mut self) -> Result<(), RlnError>
Sets the board to real-time mode. In this mode, the FEN is continuously read. Please note that this does not implement debouncing, therefore sliding a piece on the board will successively register all positions the piece passes through.
Sourcepub fn fen(&self) -> String
pub fn fen(&self) -> String
Returns the last FEN string registered by the board, if any. An empty string will be returned if the board was never put in real-time mode before.
Sourcepub fn battery_state(&self) -> u8
pub fn battery_state(&self) -> u8
Returns the battery state, in percentage.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RustyLink
impl !RefUnwindSafe for RustyLink
impl Send for RustyLink
impl Sync for RustyLink
impl Unpin for RustyLink
impl !UnwindSafe for RustyLink
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