pub struct DbClient { /* private fields */ }Implementations§
Source§impl DbClient
impl DbClient
pub async fn new(database_url: &str) -> Result<Self, Error>
pub async fn create_player(&self, name: &str) -> Result<i64, Error>
pub async fn get_or_create_player(&self, name: &str) -> Result<i64, Error>
pub async fn get_player_by_name(&self, name: &str) -> Result<Option<i64>, Error>
pub async fn create_game( &self, name: &str, white_id: i64, black_id: i64, initial_fen: &str, ) -> Result<i64, Error>
pub async fn update_game_state( &self, game_id: i64, current_fen: &str, status: &str, ) -> Result<(), Error>
pub async fn delete_game(&self, game_id: i64) -> Result<(), Error>
pub async fn log_move( &self, game_id: i64, move_number: i64, fen_snapshot: &str, notation: &str, ) -> Result<(), Error>
Sourcepub async fn undo_last_move(
&self,
game_id: i64,
) -> Result<Option<String>, Error>
pub async fn undo_last_move( &self, game_id: i64, ) -> Result<Option<String>, Error>
Natively handles the “Undo” architecture algebraically without engine reverse-math!
Sourcepub async fn get_active_games(&self) -> Result<Vec<GameRecord>, Error>
pub async fn get_active_games(&self) -> Result<Vec<GameRecord>, Error>
Fetches a dynamic matrix of active database sessions mathematically JOINed alongside explicit strings!
Sourcepub async fn load_game_history(
&self,
game_id: i64,
) -> Result<(String, Vec<String>, Vec<String>), Error>
pub async fn load_game_history( &self, game_id: i64, ) -> Result<(String, Vec<String>, Vec<String>), Error>
Recursively fetches the exact historical move vectors for resuming Egui Sandbox arrays natively!
pub async fn log_chat_message( &self, game_id: i64, role: &str, content: &str, ) -> Result<i64, Error>
pub async fn load_chat_history( &self, game_id: i64, ) -> Result<Vec<(String, String)>, Error>
Auto Trait Implementations§
impl Freeze for DbClient
impl !RefUnwindSafe for DbClient
impl Send for DbClient
impl Sync for DbClient
impl Unpin for DbClient
impl UnsafeUnpin for DbClient
impl !UnwindSafe for DbClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.