1+ //! A library implementing a URL for use in git with access to its special capabilities.
12#![ forbid( unsafe_code) ]
23#![ deny( rust_2018_idioms) ]
34
45use std:: { convert:: TryFrom , fmt} ;
56
7+ /// A scheme for use in a [`Url`]
68#[ derive( PartialEq , Eq , Debug , Hash , Ord , PartialOrd , Clone , Copy ) ]
79#[ cfg_attr( feature = "serde1" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
810pub enum Scheme {
@@ -26,13 +28,22 @@ impl fmt::Display for Scheme {
2628 }
2729}
2830
31+ /// A URL with support for specialized git related capabilities.
32+ ///
33+ /// Additionally there is support for [deserialization][Url::from_bytes()] and serialization
34+ /// (_see the `Display::fmt()` implementation_).
2935#[ derive( PartialEq , Eq , Debug , Hash , Ord , PartialOrd , Clone ) ]
3036#[ cfg_attr( feature = "serde1" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
3137pub struct Url {
38+ /// The URL scheme.
3239 pub scheme : Scheme ,
40+ /// The user to impersonate on the remote.
3341 pub user : Option < String > ,
42+ /// The host to which to connect. Localhost is implied if `None`.
3443 pub host : Option < String > ,
44+ /// The port to use when connecting to a host. If `None`, standard ports depending on `scheme` will be used.
3545 pub port : Option < u16 > ,
46+ /// The path portion of the URL, usually the location of the git repository.
3647 pub path : bstr:: BString ,
3748}
3849
0 commit comments