pub enum GitProvider {
GitHub,
GitLab,
}Expand description
Supported Git hosting providers.
Variants§
Implementations§
Source§impl GitProvider
impl GitProvider
Sourcepub fn get(url: &str) -> Result<Option<Self>>
pub fn get(url: &str) -> Result<Option<Self>>
Detects the Git provider by inspecting HTTP response headers from the given URL.
§Errors
- If the HTTP request fails (network issues, invalid URL, etc.).
§Rationale
Header-based detection avoids parsing HTML content or relying on URL patterns, providing a more reliable and lightweight approach to provider identification.
Auto Trait Implementations§
impl Freeze for GitProvider
impl RefUnwindSafe for GitProvider
impl Send for GitProvider
impl Sync for GitProvider
impl Unpin for GitProvider
impl UnsafeUnpin for GitProvider
impl UnwindSafe for GitProvider
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