Struct libpobsd::db::game_filer::GameFilter
source · pub struct GameFilter {
pub name: Option<String>,
pub engine: Option<String>,
pub runtime: Option<String>,
pub genre: Option<String>,
pub tag: Option<String>,
pub year: Option<String>,
pub dev: Option<String>,
pub publi: Option<String>,
pub status: Option<Status>,
}
Expand description
Allows for easy game filtering based on field values.
Fields§
§name: Option<String>
The name of the game.
engine: Option<String>
The engine used by the game.
runtime: Option<String>
The executable in the package.
genre: Option<String>
A vector of genres associated with the game.
tag: Option<String>
A vector of tags associated with the game.
year: Option<String>
Released year (can be text such as “early access”.
dev: Option<String>
Developer.
publi: Option<String>
Publisher.
status: Option<Status>
When tested on -current.
Implementations§
source§impl GameFilter
impl GameFilter
sourcepub fn new(
name: Option<String>,
engine: Option<String>,
runtime: Option<String>,
genre: Option<String>,
tag: Option<String>,
year: Option<String>,
dev: Option<String>,
publi: Option<String>,
status: Option<Status>
) -> Self
pub fn new( name: Option<String>, engine: Option<String>, runtime: Option<String>, genre: Option<String>, tag: Option<String>, year: Option<String>, dev: Option<String>, publi: Option<String>, status: Option<Status> ) -> Self
Create a new GameFilter.
sourcepub fn set_name(&mut self, value: &str) -> &mut Self
pub fn set_name(&mut self, value: &str) -> &mut Self
Sets the value of the field on which the filtering will be done.
sourcepub fn set_engine(&mut self, value: &str) -> &mut Self
pub fn set_engine(&mut self, value: &str) -> &mut Self
Sets the value of the field on which the filtering will be done.
sourcepub fn set_runtime(&mut self, value: &str) -> &mut Self
pub fn set_runtime(&mut self, value: &str) -> &mut Self
Sets the value of the field on which the filtering will be done.
sourcepub fn set_genre(&mut self, value: &str) -> &mut Self
pub fn set_genre(&mut self, value: &str) -> &mut Self
Sets the value of the field on which the filtering will be done.
sourcepub fn set_tag(&mut self, value: &str) -> &mut Self
pub fn set_tag(&mut self, value: &str) -> &mut Self
Sets the value of the field on which the filtering will be done.
sourcepub fn set_year(&mut self, value: &str) -> &mut Self
pub fn set_year(&mut self, value: &str) -> &mut Self
Sets the value of the field on which the filtering will be done.
sourcepub fn set_dev(&mut self, value: &str) -> &mut Self
pub fn set_dev(&mut self, value: &str) -> &mut Self
Sets the value of the field on which the filtering will be done.
sourcepub fn set_publi(&mut self, value: &str) -> &mut Self
pub fn set_publi(&mut self, value: &str) -> &mut Self
Sets the value of the field on which the filtering will be done.
sourcepub fn set_status<T: AsRef<Status>>(&mut self, status: T) -> &mut Self
pub fn set_status<T: AsRef<Status>>(&mut self, status: T) -> &mut Self
Set the status field on which the filtering will be done.
It takes a crate::GameStatus
or Status
as argument.
sourcepub fn check_game<T: AsRef<Game>>(
&self,
game: T,
search_type: &SearchType
) -> bool
pub fn check_game<T: AsRef<Game>>( &self, game: T, search_type: &SearchType ) -> bool
Check if a given Game
matches the filtering rules.
sourcepub fn filter_games<T: AsRef<Game>>(
&self,
games: Vec<T>,
search_type: &SearchType
) -> Vec<T>
pub fn filter_games<T: AsRef<Game>>( &self, games: Vec<T>, search_type: &SearchType ) -> Vec<T>
Filter a vector of Game
based on the filtering rules.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Check if at least one field of the GameFilter
is different from None.
Trait Implementations§
source§impl Clone for GameFilter
impl Clone for GameFilter
source§fn clone(&self) -> GameFilter
fn clone(&self) -> GameFilter
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GameFilter
impl Debug for GameFilter
source§impl Default for GameFilter
impl Default for GameFilter
source§fn default() -> GameFilter
fn default() -> GameFilter
source§impl<'de> Deserialize<'de> for GameFilter
impl<'de> Deserialize<'de> for GameFilter
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>,
source§impl PartialEq for GameFilter
impl PartialEq for GameFilter
source§fn eq(&self, other: &GameFilter) -> bool
fn eq(&self, other: &GameFilter) -> bool
self
and other
values to be equal, and is used
by ==
.