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
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for Conf
impl<'de> Deserialize<'de> for Conf
sourcefn 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
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> HasMut<T> for T
impl<T> HasMut<T> for T
sourcefn retrieve_mut(&mut self) -> &mut T
fn retrieve_mut(&mut self) -> &mut T
Method to retrieve the context type as mutable.