[][src]Struct git_url_parse::GitUrl

pub struct GitUrl {
    pub host: Option<String>,
    pub name: String,
    pub owner: Option<String>,
    pub organization: Option<String>,
    pub fullname: String,
    pub scheme: Scheme,
    pub user: Option<String>,
    pub token: Option<String>,
    pub port: Option<u16>,
    pub path: String,
    pub git_suffix: bool,
    pub scheme_prefix: bool,
}

GitUrl represents an input url 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

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"

scheme: Scheme

The git url scheme

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

scheme_prefix: bool

Indicate if url explicitly uses its scheme

Implementations

impl GitUrl[src]

pub fn trim_auth(&self) -> GitUrl[src]

Returns GitUrl after removing user and token values Intended use-case is for non-destructive printing GitUrl excluding any embedded auth info

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

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

Trait Implementations

impl Clone for GitUrl[src]

impl Debug for GitUrl[src]

impl Default for GitUrl[src]

impl Display for GitUrl[src]

Build the printable GitUrl from its components

impl PartialEq<GitUrl> for GitUrl[src]

impl StructuralPartialEq for GitUrl[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.