Struct couchdb::Revision [] [src]

pub struct Revision { /* fields omitted */ }

Revision contains a document revision.

Summary

  • Revision stores a revision, which is a string that looks like 1-9c65296036141e575d32ba9c034dd3ee.

  • Revision can be parsed from a string via FromStr or the Revision::parse method.

  • Revision implements Deserialize and Serialize.

Remarks

A CouchDB document revision comprises a sequence number and an MD5 digest. The sequence number (usually) starts at 1 when the document is created and increments by one each time the document is updated. The digest is a hash of the document content, which the CouchDB server uses to detect conflicts.

Example

extern crate couchdb;

let rev = couchdb::Revision::parse("42-1234567890abcdef1234567890abcdef")
    .unwrap();

assert_eq!(rev.to_string(), "42-1234567890abcdef1234567890abcdef");

Methods

impl Revision
[src]

Constructs a new Revision from the given string.

The string must be of the form 42-1234567890abcdef1234567890abcdef.

Returns the sequence number part of the revision.

The sequence number is the 42 part of the revision 42-1234567890abcdef1234567890abcdef.

Trait Implementations

impl Clone for Revision
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Revision
[src]

Formats the value using the given formatter.

impl Eq for Revision
[src]

impl Hash for Revision
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Revision
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Display for Revision
[src]

Formats the value using the given formatter. Read more

impl FromStr for Revision
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Serialize for Revision
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de> Deserialize<'de> for Revision
[src]

Deserialize this value from the given Serde deserializer. Read more