Commit 101a9236 authored by Leonardo Schwarz's avatar Leonardo Schwarz

Some more docs.

parent aa27aafd
//! Contains the types and functions to communicate with the MusicBrainz API.
use errors::{ClientError, ClientErrorKind};
use entities::{Mbid, Resource};
......@@ -183,14 +185,14 @@ mod tests {
user_agent: "MusicBrainz-Rust/Testing".to_string(),
max_retries: 5,
HttpClient::replay_file(format!("replay/src/client/mod/{}.json", testname)),
HttpClient::replay_file(format!("replay/test_client/search/{}.json", testname)),
fn search_release_group()
let mut client = get_client("search_release_group");
let mut client = get_client("release_group_01");
let results = client
/// ! For now only including the search fields of release group.
//! The fields that can be used in queries.
//! Some field types can be used for multiple entities, to make it more user friendly the types are
//! reexported to the submodules corresponding to the names of the entities which they can be used
//! to query.
use super::{Mbid, full_entities};
// use super::query::QueryExpression;
//! Query builder code.
//! In general you won't need to use any of these types directly, but instead through the
//! facilities provided by `Client`.
use super::*;
use regex::Regex;
use url::percent_encoding::{DEFAULT_ENCODE_SET, utf8_percent_encode};
......@@ -7,7 +11,8 @@ use url::percent_encoding::{DEFAULT_ENCODE_SET, utf8_percent_encode};
/// for a url string.
/// This is to be used for attribute values, like for example a release name.
pub fn escape_full(text: &str) -> String
fn escape_full(text: &str) -> String
// Replace all special lucene syntax elements.
let re = Regex::new(r#"([+\-!\(\)\{\}\[\]\^"~\*\?:\\]|[&\|]{2})"#).unwrap();
......@@ -34,7 +34,8 @@ pub use self::recording::Recording;
pub use self::release::{LabelInfo, Release, ReleaseMedium, ReleaseStatus, ReleaseTrack};
pub use self::release_group::{ReleaseGroup, ReleaseGroupPrimaryType, ReleaseGroupSecondaryType,
pub use self::series::Series;
// TODO it's pretty useless as of now.
//pub use self::series::Series;
mod mbid;
pub use self::mbid::Mbid;
// TODO: Actually the docs generated by error chain are rather misleading since
// they are exactly the same for both ClientError and ParseError.
// One work around would be to put each error chain in its own module and
// document that module, then reexport the types.
error_chain! {
types {
ParseError, ParseErrorKind, ChainParseErr;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment