Struct mwapi::client::Builder [−][src]
pub struct Builder { /* fields omitted */ }
Expand description
Build a new API client.
let client: Client = Client::builder("https://example.org/w/api.php")
.set_oauth2_token("foobar")
.set_errorformat(mwapi::ErrorFormat::Html)
.build().await?;
Implementations
Create a new Builder
instance. Typically you will use
Client::builder()
instead.
Set a custom User-agent. Ideally follow the Wikimedia User-agent policy.
Set an OAuth2 token for authentication
Set the format error messages from the API should be in
Set how many requests should be processed in parallel. On Wikimedia wikis, you shouldn’t exceed the default of 1 without getting permission from a sysadmin.
Pause when the servers are lagged for how many seconds? Typically bots should set this to 5, while interactive usage should be much higher.
See mediawiki.org for more details.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl UnwindSafe for Builder
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more