pub struct GitHubBuilder { /* private fields */ }Expand description
GitHub Builder
Implementations§
Source§impl GitHubBuilder
impl GitHubBuilder
Sourcepub fn instance(&mut self, instance: &str) -> &mut Self
pub fn instance(&mut self, instance: &str) -> &mut Self
Set the Instance URL for the GitHub Enterprise Server.
§Example
use ghastoolkit::GitHub;
let github = GitHub::init()
.instance("https://github.geekmasher.dev/")
.build()
.expect("Failed to initialise GitHub instance");
Sourcepub fn token(&mut self, token: &str) -> &mut Self
pub fn token(&mut self, token: &str) -> &mut Self
Set the Token used to authenticate with GitHub.
§Example
use ghastoolkit::GitHub;
let github = GitHub::init()
.token("personal_access_token")
.build()
.expect("Failed to initialise GitHub instance");
Sourcepub fn enterprise(&mut self, enterprise: &str) -> &mut Self
pub fn enterprise(&mut self, enterprise: &str) -> &mut Self
Set the Enterprise Account name.
Sourcepub fn github_app(&mut self, github_app: bool) -> &mut Self
pub fn github_app(&mut self, github_app: bool) -> &mut Self
Set the GitHub App flag. This is mainly used for changing the rate limits and other settings.
Sourcepub fn build(&self) -> Result<GitHub, GHASError>
pub fn build(&self) -> Result<GitHub, GHASError>
Build the GitHub instance with the provided settings.
§Example
use ghastoolkit::GitHub;
let github = GitHub::init()
.instance("https://github.geekmasher.dev/")
.owner("geekmasher")
.token("personal_access_token")
.build()
.expect("Failed to initialise GitHub instance");Trait Implementations§
Source§impl Clone for GitHubBuilder
impl Clone for GitHubBuilder
Source§fn clone(&self) -> GitHubBuilder
fn clone(&self) -> GitHubBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GitHubBuilder
impl Debug for GitHubBuilder
Auto Trait Implementations§
impl Freeze for GitHubBuilder
impl RefUnwindSafe for GitHubBuilder
impl Send for GitHubBuilder
impl Sync for GitHubBuilder
impl Unpin for GitHubBuilder
impl UnwindSafe for GitHubBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more