skade / lazers

A couchdb client in Rust
http://laze.rs
Mozilla Public License 2.0
17 stars 3 forks source link

Provide an as_ref interface for DatabaseEntry #10

Open skade opened 8 years ago

skade commented 8 years ago

DatabaseEntry currently only provides methods taking self. This means the DatabaseEntry moves and cannot be used afterwards.

Sometimes, you'd like to keep the structure around though and just get a handle on the contained document. We should also provide an implementation returning a reference to the internal document, if there is one.

A mutable reference should not be provided, as then, the inner doc should be unwrapped at submitted back to the database.