Struct couchdb::action::GetChanges
[−]
[src]
pub struct GetChanges<'a, P> where P: IntoDatabasePath {
// some fields omitted
}
Action to get changes made to documents in a database.
Return
This action returns a list of changes to documents that have occurred within
the database. However, if using the continuous feed then the returned list
is empty and the changes are instead returned via an event handler. See the
continuous
method for more information.
Errors
The following are some of the errors that may occur as a result of executing this action:
Error::BadRequest
: Bad request.
Methods
impl<'a, P: IntoDatabasePath> GetChanges<'a, P>
fn longpoll(self) -> Self
Sets the feed
query parameter to do long-polling.
fn continuous<H: 'a + ChangeHandler>(self, handler: H) -> Self
Sets the feed
query parameter to receive a continuous feed.
The continuous feed behaves differently from other feeds. When using the
continuous feed, the action returns an empty list of change results and
the change results are instead returned via the handler
argument,
which is called exactly once for each change result.
fn heartbeat<H: Into<Heartbeat>>(self, heartbeat: H) -> Self
The heartbeat is the period after which the CouchDB server sends an empty line.
The heartbeat applies only for long-polling and continuous feeds. If set, the heartbeat overrides the action's timeout, meaning the action remains open indefinitely.
fn since<S: Into<Since>>(self, seq: S) -> Self
Sets the since
query parameter.
The since
query parameter causes the action to return change results
starting after the given sequence number.
fn timeout(self, timeout: Duration) -> Self
Sets the timeout
query parameter.
fn run(self) -> Result<Changes, Error>
Sends the action request and waits for the response.