[][src]Struct git_url_parse::GitUrl

pub struct GitUrl {
    pub href: String,
    pub host: Option<String>,
    pub name: String,
    pub owner: Option<String>,
    pub organization: Option<String>,
    pub fullname: String,
    pub protocol: Protocol,
    pub user: Option<String>,
    pub token: Option<String>,
    pub port: Option<u16>,
    pub path: String,
    pub git_suffix: bool,
}

GitUrl represents an input url href that is a url used by git Internally during parsing the url is sanitized and uses the url crate to perform the majority of the parsing effort, and with some extra handling to expose metadata used my many git hosting services

Fields

href: String

The input url

host: Option<String>

The fully qualified domain name (FQDN) or IP of the repo

name: String

The name of the repo

owner: Option<String>

The owner/account/project name

organization: Option<String>

The organization name. Supported by Azure DevOps

fullname: String

The full name of the repo, formatted as "owner/name"

protocol: Protocol

The git url protocol

user: Option<String>

The authentication user

token: Option<String>

The oauth token (could appear in the https urls)

port: Option<u16>

The non-conventional port where git service is hosted

path: String

The path to repo w/ respect to user + hostname

git_suffix: bool

Indicate if url uses the .git suffix

Methods

impl GitUrl[src]

pub fn new(url: &str) -> GitUrl[src]

Returns a new GitUrl with provided url set as href

pub fn parse(url: &str) -> Result<GitUrl>[src]

Returns a Result<GitUrl> after normalizing and parsing url for metadata

Trait Implementations

impl Debug for GitUrl[src]

impl Default for GitUrl[src]

impl Display for GitUrl[src]

impl PartialEq<GitUrl> for GitUrl[src]

impl StructuralPartialEq for GitUrl[src]

Auto Trait Implementations

impl RefUnwindSafe for GitUrl

impl Send for GitUrl

impl Sync for GitUrl

impl Unpin for GitUrl

impl UnwindSafe for GitUrl

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> ToString for T where
    T: Display + ?Sized
[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.