Skip to content

Commit 8a1a0cc

Browse files
committed
---
yaml --- r: 147006 b: refs/heads/try2 c: 2c1acd7 h: refs/heads/master v: v3
1 parent e1cb199 commit 8a1a0cc

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0515e0541f6fed6e1b50d1b558ffe45625cd4a35
8+
refs/heads/try2: 2c1acd7998d9a99bd16ee59fe1fd68d1eece4c3e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libextra/url.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,35 @@ use std::uint;
2222
/// A Uniform Resource Locator (URL). A URL is a form of URI (Uniform Resource
2323
/// Identifier) that includes network location information, such as hostname or
2424
/// port number.
25+
///
26+
/// # Example
27+
///
28+
/// ```rust
29+
/// let url = Url { scheme: ~"https",
30+
/// user: Some(UserInfo { user: ~"username", pass: None }),
31+
/// host: ~"example.com",
32+
/// port: Some(~"8080"),
33+
/// path: ~"/foo/bar",
34+
/// query: ~[(~"baz", ~"qux")],
35+
/// fragment: Some(~"quz") };
36+
/// // https://[email protected]:8080/foo/bar?baz=qux#quz
37+
/// ```
2538
#[deriving(Clone, Eq)]
2639
pub struct Url {
27-
/// The scheme part of a URL, such as `http`, `ftp` or `mailto`.
40+
/// The scheme part of a URL, such as `https` in the above example.
2841
scheme: ~str,
29-
/// A URL subcomponent for user authentication.
42+
/// A URL subcomponent for user authentication. `username` in the above example.
3043
user: Option<UserInfo>,
31-
/// A domain name or IP address. For example, `www.example.com`.
44+
/// A domain name or IP address. For example, `example.com`.
3245
host: ~str,
3346
/// A TCP port number, for example `8080`.
3447
port: Option<~str>,
35-
/// The path component of a URL, for example `/users/jsmith`.
48+
/// The path component of a URL, for example `/foo/bar`.
3649
path: ~str,
37-
/// The query component of a URL.
50+
/// The query component of a URL. `~[(~"baz", ~"qux")]` represents the
51+
/// fragment `baz=qux` in the above example.
3852
query: Query,
39-
/// The fragment component. Does not include the leading hash or pound sign.
53+
/// The fragment component, such as `quz`. Doesn't include the leading `#` character.
4054
fragment: Option<~str>
4155
}
4256

0 commit comments

Comments
 (0)