Skip to main content

Crate gix_url

Crate gix_url 

Source
Expand description

A library implementing a URL for use in git with access to its special capabilities.

§Examples

let mut url = gix_url::parse("ssh://git@example.com/gitoxide".into()).unwrap();
assert_eq!(url.user(), Some("git"));
assert_eq!(url.host(), Some("example.com"));
assert_eq!(url.to_bstring(), "ssh://git@example.com/gitoxide");

assert_eq!(url.set_user(Some("byron".into())), Some("git".into()));
assert_eq!(url.user_argument_safe(), Some("byron"));
assert_eq!(url.to_bstring(), "ssh://byron@example.com/gitoxide");

let suspicious = gix_url::parse("ssh://-Fconfig@host/repo".into()).unwrap();
assert_eq!(suspicious.user_argument_safe(), None, "The user isn't returned as it looks like an argument");

§Feature Flags

  • serde — Data structures implement serde::Serialize and serde::Deserialize.

Modules§

expand_path
Functions for expanding repository paths.
parse

Structs§

Url
A URL with support for specialized git related capabilities.

Enums§

ArgumentSafety
Classification of a portion of a URL by whether it is syntactically safe to pass as an argument to a command-line program.
Scheme
A scheme or protocol for use in a Url.

Functions§

expand_path
Expand path for the given user, which can be obtained by parse(), resolving the home directories of user automatically.
parse
Parse the given bytes as a git url.