Function etcd::kv::create_in_order [] [src]

pub fn create_in_order<C>(
    client: &Client<C>,
    key: &str,
    value: &str,
    ttl: Option<u64>
) -> FutureKeyValueInfo where
    C: Clone + Connect

Creates a new key-value pair in a directory with a numeric key name larger than any of its sibling key-value pairs.

For example, the first value created with this function under the directory "/foo" will have a key name like "00000000000000000001" automatically generated. The second value created with this function under the same directory will have a key name like "00000000000000000002".

This behavior is guaranteed by the server.

Parameters

  • client: A Client to use to make the API call.
  • key: The name of the directory to create a key-value pair in.
  • value: The new value for the key-value pair.
  • ttl: If given, the node will expire after this many seconds.

Errors

Fails if the key already exists and is not a directory.