pub struct Endpoints { /* private fields */ }Expand description
Where GitHub is.
Two bases rather than one, because the device grant lives on github.com
while every API call lives on api.github.com. Tests point both at one
wiremock server; the paths do not collide.
Implementations§
Source§impl Endpoints
impl Endpoints
Sourcepub fn production() -> Self
pub fn production() -> Self
Sourcepub fn new(api_base: Url, web_base: Url) -> Self
pub fn new(api_base: Url, web_base: Url) -> Self
Both bases are normalised to end in / so that relative joins keep the
whole base path instead of replacing its last segment.
Sourcepub fn for_test_server(root: &str) -> Result<Self, ConfigError>
pub fn for_test_server(root: &str) -> Result<Self, ConfigError>
pub fn api_base(&self) -> &Url
pub fn web_base(&self) -> &Url
Sourcepub fn device_code_url(&self) -> Url
pub fn device_code_url(&self) -> Url
§Panics
Never: the path is a constant and the base ends in /.
Sourcepub fn access_token_url(&self) -> Url
pub fn access_token_url(&self) -> Url
§Panics
Never: the path is a constant and the base ends in /.
Sourcepub fn verification_url(&self) -> Url
pub fn verification_url(&self) -> Url
The canonical page the user code is typed into, and the only device-flow URL this product ever prints.
§Panics
Never: the path is a constant and the base ends in /.
Trait Implementations§
impl Eq for Endpoints
impl StructuralPartialEq for Endpoints
Auto Trait Implementations§
impl Freeze for Endpoints
impl RefUnwindSafe for Endpoints
impl Send for Endpoints
impl Sync for Endpoints
impl Unpin for Endpoints
impl UnsafeUnpin for Endpoints
impl UnwindSafe for Endpoints
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.