pub struct ClientConfig {
pub game_host: Option<String>,
pub api_port: Option<u16>,
pub game_port: Option<u16>,
pub gfx_window: GfxWindowPrefs,
}Fields§
§game_host: Option<String>Gateway host (IPv4, IPv6, or DNS name). Port defaults to 7373.
api_port: Option<u16>Control plane HTTP port when game_host is set. Defaults to 7380.
game_port: Option<u16>Gateway TCP port when game_host is set. Defaults to 7373.
gfx_window: GfxWindowPrefsGfx play window geometry (flatland3-gfx).
Implementations§
Source§impl ClientConfig
impl ClientConfig
pub fn path() -> Result<PathBuf>
pub fn load() -> Self
pub fn save(&self) -> Result<()>
pub fn save_gfx_window(&mut self, prefs: GfxWindowPrefs) -> Result<()>
pub fn set_game_host(&mut self, host: impl Into<String>) -> Result<()>
pub fn game_server_addr(&self) -> SocketAddr
pub fn api_base_url(&self) -> String
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClientConfig
impl Debug for ClientConfig
Source§impl Default for ClientConfig
impl Default for ClientConfig
Source§fn default() -> ClientConfig
fn default() -> ClientConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ClientConfig
impl<'de> Deserialize<'de> for ClientConfig
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
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin for ClientConfig
impl UnwindSafe for ClientConfig
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