Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jedestep committed Aug 9, 2013
1 parent d30fccb commit 857e14a
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docs/bson/encode.md
Expand Up @@ -50,6 +50,8 @@ by using the Embedded variant.

* `Regex(~str, ~str)`

* `DBRef(~str, ~Document)`

* `JScript(~str)`

* `JScriptWithScope(~str, ~BsonDocument)`
Expand Down
6 changes: 6 additions & 0 deletions docs/gridfs/gridfs.md
Expand Up @@ -43,6 +43,12 @@ fn file_write(&self) -> GridWriter
fn put(&mut self, data: ~[u8]) -> Result<(), MongoErr>
~~~

### Method `get`

~~~ {.rust}
fn get(&mut self, size: uint) -> Result<~[u8], MongoErr>
~~~

### Method `delete`

~~~ {.rust}
Expand Down
48 changes: 48 additions & 0 deletions docs/mongo/client.md
Expand Up @@ -13,6 +13,7 @@
pub struct Client {
conn: Cell<@Connection>,
timeout: u64,
wc: Cell<Option<~[WRITE_CONCERN]>>,
priv rs_conn: Cell<@ReplicaSetConnection>,
priv cur_requestId: Cell<i32>,
}
Expand Down Expand Up @@ -171,6 +172,42 @@ Connect to replica set with specified seed list.

() on success, MongoErr on failure

### Method `connect_with_uri`

~~~ {.rust}
fn connect_with_uri(@self, uri_str: &str) -> Result<(), MongoErr>
~~~

Connect via URI connection string.

See [Connection String URI Format](http://docs.mongodb.org/manual/reference/connection-string/)
for the URI specification. Please note, however, that because of the
way the Rust URL parser operates, if the username/password option is
included, so must be the '/' that would follow the hosts, even if
the desired database to use is admin (the default).

Currently supported options:
* w
* wtimeoutMS
* journal
* readPreference
* readPreferenceTags

#### Arguments

* `uri_str` - string containing connection parameters

#### Returns

() on success, MongoErr on failure (on URI parsing, connection, or
option setting)

### Method `_try_connect_with_uri`

~~~ {.rust}
fn _try_connect_with_uri(@self, uri_str: &str) -> Result<(), MongoErr>
~~~

### Method `initiate_rs`

~~~ {.rust}
Expand Down Expand Up @@ -207,6 +244,15 @@ Sets read preference as specified, returning former preference.

old read preference on success, MongoErr on failure

### Method `set_default_wc`

~~~ {.rust}
fn set_default_wc(&self, wc: Option<~[WRITE_CONCERN]>) ->
Option<~[WRITE_CONCERN]>
~~~

Sets default write concern to use, returning the former one.

### Method `disconnect`

~~~ {.rust}
Expand Down Expand Up @@ -275,3 +321,5 @@ Increments first unused requestId and returns former value.
fn check_version(@self, ver: ~str) -> Result<(), MongoErr>
~~~

Ensure the mongod instance to which this client is connected is at least the provided version.

6 changes: 4 additions & 2 deletions docs/mongo/db.md
Expand Up @@ -150,7 +150,8 @@ appropriately by caller, `MongoErr` on failure
### Method `get_last_error`

~~~ {.rust}
fn get_last_error(&self, wc: Option<~[WRITE_CONCERN]>) -> Result<(), MongoErr>
fn get_last_error(&self, wc: Option<~[WRITE_CONCERN]>) ->
Result<Option<~BsonDocument>, MongoErr>
~~~

Parses write concern into bytes and sends to server.
Expand All @@ -161,7 +162,8 @@ Parses write concern into bytes and sends to server.

#### Returns

() on success, `MongoErr` on failure
`Option<~BsonDocument>` with full response on success (or None
if write concern was 0), `MongoErr` on failure

#### Failure Types

Expand Down
2 changes: 1 addition & 1 deletion docs/mongo/index.md
Expand Up @@ -336,7 +336,7 @@ fn process_index_opts(flags: i32, options: Option<~[INDEX_OPTION]>) ->
### Method `process_index_fields`

~~~ {.rust}
fn process_index_fields(index_arr: ~[INDEX_TYPE], index_opts: &mut ~[~str],
fn process_index_fields(index_arr: &[INDEX_TYPE], index_opts: &mut ~[~str],
get_name: bool) -> (~str, ~[~str])
~~~

Expand Down
4 changes: 2 additions & 2 deletions docs/mongo/rs.md
Expand Up @@ -393,7 +393,7 @@ Reconfigure replica set to have given configuration.
### Method `node_freeze`

~~~ {.rust}
fn node_freeze(&self, host: ~str, sec: uint) -> Result<(), MongoErr>
fn node_freeze(&self, host: ~str, sec: u64) -> Result<(), MongoErr>
~~~

Prevent specified node from seeking election for
Expand All @@ -408,7 +408,7 @@ fn node_unfreeze(&self, host: ~str) -> Result<(), MongoErr>
### Method `step_down`

~~~ {.rust}
fn step_down(&self, sec: uint) -> Result<(), MongoErr>
fn step_down(&self, sec: u64) -> Result<(), MongoErr>
~~~

Forces current primary to step down for specified number of seconds.
Expand Down
87 changes: 86 additions & 1 deletion docs/mongo/util.md
Expand Up @@ -29,19 +29,26 @@
* [Enum `UPDATE_OPTION`](#enum-update_option)
* [Enum `WRITE_CONCERN`](#enum-write_concern)
* [Struct `MongoErr`](#struct-mongoerr) - Utility module for use internal and external to crate
* [Struct `MongoUri`](#struct-mongouri)
* [Struct `TagSet`](#struct-tagset)
* [Implementation ` of ::std::clone::Clone for MongoErr`](#implementation-of-stdcloneclone-for-mongoerr) - Automatically derived.
* [Implementation ` of ::std::cmp::Eq for MongoErr`](#implementation-of-stdcmpeq-for-mongoerr) - Automatically derived.
* [Implementation ` for MongoErr`](#implementation-for-mongoerr) - MongoErr to propagate errors.
* [Implementation ` of ToStr for MongoErr`](#implementation-of-tostr-for-mongoerr)
* [Implementation ` of FromStr for MongoUri`](#implementation-of-fromstr-for-mongouri)
* [Implementation ` of ::std::clone::Clone for QuerySpec`](#implementation-of-stdcloneclone-for-queryspec) - Automatically derived.
* [Implementation ` of ::std::cmp::Eq for QuerySpec`](#implementation-of-stdcmpeq-for-queryspec) - Automatically derived.
* [Implementation ` of ToStr for QuerySpec`](#implementation-of-tostr-for-queryspec)
* [Implementation ` of ::std::cmp::Eq for TagSet`](#implementation-of-stdcmpeq-for-tagset) - Automatically derived.
* [Implementation ` of Clone for TagSet`](#implementation-of-clone-for-tagset)
* [Implementation ` of BsonFormattable for TagSet`](#implementation-of-bsonformattable-for-tagset)
* [Implementation ` for TagSet`](#implementation-for-tagset)
* [Implementation ` of ::std::clone::Clone for WRITE_CONCERN`](#implementation-of-stdcloneclone-for-write_concern) - Automatically derived.
* [Implementation ` of ::std::cmp::Eq for WRITE_CONCERN`](#implementation-of-stdcmpeq-for-write_concern) - Automatically derived.
* [Implementation ` of ::std::clone::Clone for READ_PREFERENCE`](#implementation-of-stdcloneclone-for-read_preference) - Automatically derived.
* [Implementation ` of ::std::cmp::Eq for READ_PREFERENCE`](#implementation-of-stdcmpeq-for-read_preference) - Automatically derived.
* [Function `parse_host`](#function-parse_host)
* [Function `parse_tags`](#function-parse_tags)

</div>

Expand Down Expand Up @@ -274,6 +281,18 @@ pub struct MongoErr {
Utility module for use internal and external to crate.
Users must access functionality for proper use of options, etc.

## Struct `MongoUri`

~~~ {.rust}
pub struct MongoUri {
user: Option<url::UserInfo>,
hosts: ~[~str],
ports: ~[uint],
db: ~str,
options: url::Query,
}
~~~

## Struct `TagSet`

~~~ {.rust}
Expand Down Expand Up @@ -339,6 +358,40 @@ fn to_str(&self) -> ~str

Prints a MongoErr to string in a standard format.

## Implementation of `FromStr` for `MongoUri`

### Method `from_str`

~~~ {.rust}
fn from_str(s: &str) -> Option<MongoUri>
~~~

## Implementation of `::std::clone::Clone` for `QuerySpec`

Automatically derived.

### Method `clone`

~~~ {.rust}
fn clone(&self) -> QuerySpec
~~~

## Implementation of `::std::cmp::Eq` for `QuerySpec`

Automatically derived.

### Method `eq`

~~~ {.rust}
fn eq(&self, __arg_0: &QuerySpec) -> ::bool
~~~

### Method `ne`

~~~ {.rust}
fn ne(&self, __arg_0: &QuerySpec) -> ::bool
~~~

## Implementation of `ToStr` for `QuerySpec`

### Method `to_str`
Expand Down Expand Up @@ -425,6 +478,32 @@ in self's TagSet.

Usage: member.matches(tagset)

## Implementation of `::std::clone::Clone` for `WRITE_CONCERN`

Automatically derived.

### Method `clone`

~~~ {.rust}
fn clone(&self) -> WRITE_CONCERN
~~~

## Implementation of `::std::cmp::Eq` for `WRITE_CONCERN`

Automatically derived.

### Method `eq`

~~~ {.rust}
fn eq(&self, __arg_0: &WRITE_CONCERN) -> ::bool
~~~

### Method `ne`

~~~ {.rust}
fn ne(&self, __arg_0: &WRITE_CONCERN) -> ::bool
~~~

## Implementation of `::std::clone::Clone` for `READ_PREFERENCE`

Automatically derived.
Expand Down Expand Up @@ -454,6 +533,12 @@ fn ne(&self, __arg_0: &READ_PREFERENCE) -> ::bool
## Function `parse_host`

~~~ {.rust}
fn parse_host(host_str: &~str) -> Result<(~str, uint), MongoErr>
fn parse_host(host_str: &str) -> Result<(~str, uint), MongoErr>
~~~

## Function `parse_tags`

~~~ {.rust}
fn parse_tags(tag_str: &str) -> Result<Option<TagSet>, MongoErr>
~~~

0 comments on commit 857e14a

Please sign in to comment.