pub struct Conf {
pub window_mode: WindowMode,
pub window_setup: WindowSetup,
pub backend: Backend,
}
Expand description
A structure containing configuration data for the game engine.
Defaults:
Conf {
window_mode: WindowMode::default(),
window_setup: WindowSetup::default(),
backend: Backend::default(),
}
Fields§
§window_mode: WindowMode
Window setting information that can be set at runtime
window_setup: WindowSetup
Window setting information that must be set at init-time
backend: Backend
Graphics backend configuration
Implementations§
source§impl Conf
impl Conf
sourcepub fn from_toml_file<R: Read>(file: &mut R) -> GameResult<Conf>
pub fn from_toml_file<R: Read>(file: &mut R) -> GameResult<Conf>
Load a TOML file from the given Read
and attempts to parse
a Conf
from it.
sourcepub fn to_toml_file<W: Write>(&self, file: &mut W) -> GameResult
pub fn to_toml_file<W: Write>(&self, file: &mut W) -> GameResult
Saves the Conf
to the given Write
object,
formatted as TOML.
sourcepub fn window_mode(self, window_mode: WindowMode) -> Self
pub fn window_mode(self, window_mode: WindowMode) -> Self
Sets the window mode
Trait Implementations§
source§impl<'de> Deserialize<'de> for Conf
impl<'de> Deserialize<'de> for Conf
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Conf> for Conf
impl PartialEq<Conf> for Conf
impl StructuralPartialEq for Conf
Auto Trait Implementations§
impl RefUnwindSafe for Conf
impl Send for Conf
impl Sync for Conf
impl Unpin for Conf
impl UnwindSafe for Conf
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
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
source§impl<T> HasMut<T> for T
impl<T> HasMut<T> for T
source§fn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.