Struct octocat_rs::github::client_builder::ClientBuilder
source · pub struct ClientBuilder<T>where
T: Debug + EventHandler<GitHubClient = Client<T>> + Send + Sync + 'static,{ /* private fields */ }
Expand description
A builder for Client
Implementations§
source§impl<T> ClientBuilder<T>where
T: Debug + EventHandler<GitHubClient = Client<T>> + Send + Sync + 'static,
impl<T> ClientBuilder<T>where T: Debug + EventHandler<GitHubClient = Client<T>> + Send + Sync + 'static,
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ClientBuilder
sourcepub fn event_handler(self, event_handler: T) -> Self
pub fn event_handler(self, event_handler: T) -> Self
Adds an EventHandler
to the current builder.
sourcepub fn payload_size(self, size: u64) -> Self
pub fn payload_size(self, size: u64) -> Self
Sets the maximum payload size that the listener can receive from GitHub in MiB. Default: 8.
sourcepub fn user_agent<V: Into<String>>(self, user_agent: V) -> Self
pub fn user_agent<V: Into<String>>(self, user_agent: V) -> Self
Sets a custom user agent for your application. Default is “Octocat-rs”.
See also: HttpClient::set_ua
sourcepub fn credentials_file<P: AsRef<Path>>(self, file: P) -> Self
pub fn credentials_file<P: AsRef<Path>>(self, file: P) -> Self
Adds an Authorization
instance to the current builder using input
from a file.
sourcepub fn credentials_env_var<K: AsRef<OsStr>>(
self,
username_var: K,
token_var: K
) -> Self
pub fn credentials_env_var<K: AsRef<OsStr>>( self, username_var: K, token_var: K ) -> Self
Adds an Authorization
instance to the current builder using input
from an environment variable.
sourcepub fn personal_auth<V: Into<String>>(self, username: V, token: V) -> Self
pub fn personal_auth<V: Into<String>>(self, username: V, token: V) -> Self
Adds an Authorization
instance to the current builder.
source§impl ClientBuilder<DefaultEventHandler>
impl ClientBuilder<DefaultEventHandler>
sourcepub fn build_unconfigured() -> Client<DefaultEventHandler>
pub fn build_unconfigured() -> Client<DefaultEventHandler>
Returns the default implementation of Client
sourcepub fn build_no_handler(self) -> Result<Client<DefaultEventHandler>>
pub fn build_no_handler(self) -> Result<Client<DefaultEventHandler>>
For building the current builder without setting a handler.
Requires T to be set to DefaultEventHandler
.
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for ClientBuilder<T>where T: RefUnwindSafe,
impl<T> Send for ClientBuilder<T>
impl<T> Sync for ClientBuilder<T>
impl<T> Unpin for ClientBuilder<T>where T: Unpin,
impl<T> UnwindSafe for ClientBuilder<T>where T: UnwindSafe,
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