[][src]Struct octocrab::OctocrabBuilder

pub struct OctocrabBuilder { /* fields omitted */ }

A Builder struct for Octocrab.

Implementations

impl OctocrabBuilder[src]

A builder struct for Octocrab, allowing you to configure the client, such as using GitHub previews, the github instance, authentication, etc.

let octocrab = octocrab::OctocrabBuilder::new()
    .add_preview("machine-man")
    .base_url("https://github.example.com")?
    .build()?;

pub fn new() -> Self[src]

pub fn add_preview(self, preview: &'static str) -> Self[src]

Enable a GitHub preview.

pub fn personal_token(self, token: String) -> Self[src]

Add a personal token to use for authentication.

pub fn base_url(self, base_url: impl IntoUrl) -> Result<Self>[src]

Set the base url for Octocrab.

pub fn build(self) -> Result<Octocrab>[src]

Create the Octocrab client.

Trait Implementations

impl Default for OctocrabBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.