Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c891901

Browse files
committed
begin of documenting git-url crate
1 parent 60036f2 commit c891901

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

git-url/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
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

45
use 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))]
810
pub 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))]
3137
pub 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

Comments
 (0)