pub struct ScreepsConfig {
pub token: Option<String>,
pub email: Option<String>,
pub password: Option<String>,
pub host: String,
pub secure: bool,
pub timeout: u64,
}Expand description
Screeps 配置
Fields§
§token: Option<String>游戏 token
email: Option<String>游戏绑定的邮箱
password: Option<String>游戏密码
host: String游戏主机地址:域名+端口
secure: bool是否使用 https
timeout: u64请求超时时间
Implementations§
Source§impl ScreepsConfig
impl ScreepsConfig
pub fn new( token: Option<String>, email: Option<String>, password: Option<String>, host: String, secure: bool, timeout: u64, ) -> Self
Sourcepub fn with_token(&mut self, token: String)
pub fn with_token(&mut self, token: String)
设置 token
Sourcepub fn with_email(&mut self, email: String)
pub fn with_email(&mut self, email: String)
设置邮箱
Sourcepub fn with_password(&mut self, password: String)
pub fn with_password(&mut self, password: String)
设置密码
Sourcepub fn with_secure(&mut self, secure: bool)
pub fn with_secure(&mut self, secure: bool)
设置是否启用 https
Sourcepub fn with_timeout(&mut self, timeout: u64)
pub fn with_timeout(&mut self, timeout: u64)
设置请求超时
Sourcepub fn build_base_url(&self) -> String
pub fn build_base_url(&self) -> String
构造游戏服务器请求 url 前缀 url
Trait Implementations§
Source§impl Debug for ScreepsConfig
impl Debug for ScreepsConfig
Auto Trait Implementations§
impl Freeze for ScreepsConfig
impl RefUnwindSafe for ScreepsConfig
impl Send for ScreepsConfig
impl Sync for ScreepsConfig
impl Unpin for ScreepsConfig
impl UnwindSafe for ScreepsConfig
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