Skip to content

Commit

Permalink
Add struct and type doc comments for extra::url::*
Browse files Browse the repository at this point in the history
  • Loading branch information
dhodder committed Dec 1, 2013
1 parent c470184 commit 0515e05
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/libextra/url.rs
Expand Up @@ -19,23 +19,37 @@ use std::hashmap::HashMap;
use std::to_bytes;
use std::uint;

/// A Uniform Resource Locator (URL). A URL is a form of URI (Uniform Resource
/// Identifier) that includes network location information, such as hostname or
/// port number.
#[deriving(Clone, Eq)]
pub struct Url {
/// The scheme part of a URL, such as `http`, `ftp` or `mailto`.
scheme: ~str,
/// A URL subcomponent for user authentication.
user: Option<UserInfo>,
/// A domain name or IP address. For example, `www.example.com`.
host: ~str,
/// A TCP port number, for example `8080`.
port: Option<~str>,
/// The path component of a URL, for example `/users/jsmith`.
path: ~str,
/// The query component of a URL.
query: Query,
/// The fragment component. Does not include the leading hash or pound sign.
fragment: Option<~str>
}

/// An optional subcomponent of a URI authority component.
#[deriving(Clone, Eq)]
pub struct UserInfo {
/// The user name.
user: ~str,
/// Password or other scheme-specific authentication information.
pass: Option<~str>
}

/// Represents the query component of a URI.
pub type Query = ~[(~str, ~str)];

impl Url {
Expand Down

0 comments on commit 0515e05

Please sign in to comment.