Struct kuon::ClientBuilder [−][src]
pub struct ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> { /* fields omitted */ }
A ClientBuilder
can help construct a TwitterAPI
instance with your configuration.
Before calling build
method, you must set four values:
Access token
Access token secret
API key
API secret key
The four setter methods can be called with any order.
Example
use kuon::ClientBuilder; let builder = ClientBuilder::new(); // The order of setter methods can be changed. let api_client = builder .access_token("YOUR_ACCESS_TOKEN") .access_token_secret("YOUR_ACCESS_TOKEN_SECRET") .api_key("YOUR_API_KEY") .api_secret_key("YOUR_API_SECRET_KEY") .build() // This can be called only after all values have been set. .await?;
Implementations
impl ClientBuilder<(), (), (), ()>
[src]
impl ClientBuilder<(), (), (), ()>
[src]pub fn new() -> Self
[src]
pub fn new() -> Self
[src]Creates a builder instance.
This is exactly equivalent to TwitterAPI::builder
.
impl ClientBuilder<(), (), String, String>
[src]
impl ClientBuilder<(), (), String, String>
[src]pub async fn pre_build(&self, callback: Callback) -> Result<OAuthRequestToken>
[src]
pub async fn build(
self,
request_token: OAuthRequestToken,
verifier: &str
) -> Result<TwitterAPI>
[src]
self,
request_token: OAuthRequestToken,
verifier: &str
) -> Result<TwitterAPI>
impl ClientBuilder<String, String, String, String>
[src]
impl ClientBuilder<String, String, String, String>
[src]pub async fn build(self) -> Result<TwitterAPI>
[src]
pub async fn build(self) -> Result<TwitterAPI>
[src]Builds a TwitterAPI
instance with the values you’ve set.
You can call this method only after the four required values have been set.
Error
This method fails if there is an error when obtaining a bearer token.
impl<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]
impl<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]pub fn access_token(
self,
access_token: impl Into<String>
) -> ClientBuilder<String, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]
pub fn access_token(
self,
access_token: impl Into<String>
) -> ClientBuilder<String, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]Sets the access token.
pub fn access_token_secret(
self,
access_token_secret: impl Into<String>
) -> ClientBuilder<AccessTokenType, String, ApiKeyType, ApiKeySecretType>
[src]
pub fn access_token_secret(
self,
access_token_secret: impl Into<String>
) -> ClientBuilder<AccessTokenType, String, ApiKeyType, ApiKeySecretType>
[src]Sets the access token secret.
pub fn api_key(
self,
api_key: impl Into<String>
) -> ClientBuilder<AccessTokenType, AccessTokenSecretType, String, ApiKeySecretType>
[src]
pub fn api_key(
self,
api_key: impl Into<String>
) -> ClientBuilder<AccessTokenType, AccessTokenSecretType, String, ApiKeySecretType>
[src]Sets the api key.
pub fn api_secret_key(
self,
api_secret_key: impl Into<String>
) -> ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, String>
[src]
pub fn api_secret_key(
self,
api_secret_key: impl Into<String>
) -> ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, String>
[src]Sets the api secret key.
Trait Implementations
impl<AccessTokenType: Debug, AccessTokenSecretType: Debug, ApiKeyType: Debug, ApiKeySecretType: Debug> Debug for ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]
impl<AccessTokenType: Debug, AccessTokenSecretType: Debug, ApiKeyType: Debug, ApiKeySecretType: Debug> Debug for ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]impl<AccessTokenType: Default, AccessTokenSecretType: Default, ApiKeyType: Default, ApiKeySecretType: Default> Default for ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]
impl<AccessTokenType: Default, AccessTokenSecretType: Default, ApiKeyType: Default, ApiKeySecretType: Default> Default for ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]fn default(
) -> ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]
fn default(
) -> ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType>
[src]Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> RefUnwindSafe for ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> where
AccessTokenSecretType: RefUnwindSafe,
AccessTokenType: RefUnwindSafe,
ApiKeySecretType: RefUnwindSafe,
ApiKeyType: RefUnwindSafe,
AccessTokenSecretType: RefUnwindSafe,
AccessTokenType: RefUnwindSafe,
ApiKeySecretType: RefUnwindSafe,
ApiKeyType: RefUnwindSafe,
impl<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> Send for ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> where
AccessTokenSecretType: Send,
AccessTokenType: Send,
ApiKeySecretType: Send,
ApiKeyType: Send,
AccessTokenSecretType: Send,
AccessTokenType: Send,
ApiKeySecretType: Send,
ApiKeyType: Send,
impl<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> Sync for ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> where
AccessTokenSecretType: Sync,
AccessTokenType: Sync,
ApiKeySecretType: Sync,
ApiKeyType: Sync,
AccessTokenSecretType: Sync,
AccessTokenType: Sync,
ApiKeySecretType: Sync,
ApiKeyType: Sync,
impl<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> Unpin for ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> where
AccessTokenSecretType: Unpin,
AccessTokenType: Unpin,
ApiKeySecretType: Unpin,
ApiKeyType: Unpin,
AccessTokenSecretType: Unpin,
AccessTokenType: Unpin,
ApiKeySecretType: Unpin,
ApiKeyType: Unpin,
impl<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> UnwindSafe for ClientBuilder<AccessTokenType, AccessTokenSecretType, ApiKeyType, ApiKeySecretType> where
AccessTokenSecretType: UnwindSafe,
AccessTokenType: UnwindSafe,
ApiKeySecretType: UnwindSafe,
ApiKeyType: UnwindSafe,
AccessTokenSecretType: UnwindSafe,
AccessTokenType: UnwindSafe,
ApiKeySecretType: UnwindSafe,
ApiKeyType: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,