Struct screeps_api::sync::Config
[−]
[src]
pub struct Config<'a, C = UseHttpsConnector, T = UseRcTokens> { /* fields omitted */ }
Configuration for construction a SyncApi
.
Methods
impl Config<'static, UseHttpsConnector, UseRcTokens>
[src]
fn new() -> Result<Self>
[src]
Creates an initial config which will use an HTTPS connector and non-Send tokens.
impl<'a, C, T> Config<'a, C, T>
[src]
fn connector<F, CC>(self, connector: F) -> Config<'a, CC, T> where
F: FnOnce(&Handle) -> CC,
[src]
F: FnOnce(&Handle) -> CC,
Sets the Hyper connector to connect to to the given connector.
fn try_connector<F, E, CC>(self, connector: F) -> Result<Config<'a, CC, T>, E> where
F: FnOnce(&Handle) -> Result<CC, E>,
[src]
F: FnOnce(&Handle) -> Result<CC, E>,
Sets the Hyper connector to connect to to the given connector.
fn url<'b>(self, url: &'b AsRef<str>) -> Config<'b, C, T>
[src]
Sets the url to connect to to the given url.
fn tokens<TT>(self, tokens: TT) -> Config<'a, C, TT>
[src]
Sets the token storage for the config to the given token storage.
impl<'a, T: TokenStorage> Config<'a, UseHttpsConnector, T>
[src]
fn build(self) -> Result<SyncApi<HttpsConnector<HttpConnector>, T>, SyncError>
[src]
Builds the config into a SyncApi.
impl<'a, C: Connect> Config<'a, C, UseRcTokens>
[src]
fn build(self) -> Result<SyncApi<C, RcTokenStorage>, SyncError>
[src]
Builds the config into a SyncApi.
impl<'a> Config<'a, UseHttpsConnector, UseRcTokens>
[src]
fn build(
self
) -> Result<SyncApi<HttpsConnector<HttpConnector>, RcTokenStorage>, SyncError>
[src]
self
) -> Result<SyncApi<HttpsConnector<HttpConnector>, RcTokenStorage>, SyncError>
Builds the config into a SyncApi.