pub struct MatchDB {
pub conn: Connection,
pub cards_database: CardsDatabase,
}Fields§
§conn: Connection§cards_database: CardsDatabaseImplementations§
Source§impl MatchDB
impl MatchDB
pub fn new(conn: Connection, cards_database: CardsDatabase) -> Self
Sourcepub fn init(&mut self) -> Result<()>
pub fn init(&mut self) -> Result<()>
§Errors
will return an error if the database cannot be contacted for some reason or if the migrations cannot be applied
Sourcepub fn execute(
&mut self,
query: &str,
params: impl RusqliteParams,
) -> RusqliteResult<usize>
pub fn execute( &mut self, query: &str, params: impl RusqliteParams, ) -> RusqliteResult<usize>
§Errors
passes along errors from Rusqlite
Sourcepub fn get_match_results(&mut self, match_id: &str) -> Result<Vec<MatchResult>>
pub fn get_match_results(&mut self, match_id: &str) -> Result<Vec<MatchResult>>
§Errors
will return an error if the database cannot be contacted for some reason
Sourcepub fn get_decklists(&mut self, match_id: &str) -> Result<Vec<Deck>>
pub fn get_decklists(&mut self, match_id: &str) -> Result<Vec<Deck>>
§Errors
will return an error if the database cannot be contacted for some reason
Sourcepub fn get_mulligans(&mut self, match_id: &str) -> Result<Vec<Mulligan>>
pub fn get_mulligans(&mut self, match_id: &str) -> Result<Vec<Mulligan>>
§Errors
will return an error if the database cannot be contacted for some reason
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MatchDB
impl !RefUnwindSafe for MatchDB
impl !Sync for MatchDB
impl !UnwindSafe for MatchDB
impl Send for MatchDB
impl Unpin for MatchDB
impl UnsafeUnpin for MatchDB
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 more