Struct zkstate::ZkState[][src]

pub struct ZkState<T: Serialize + DeserializeOwned + Send + Sync> { /* fields omitted */ }

Implementations

Create an Empty, do nothing, ZkState object.

Create a new instance of ZkState, but does not attempt to create an empty object if none already exists. Will wait for data to show up.

So, if you know that a ZkState instance will eventually appear at the /foo/bar znode, this will block waiting for that to show up.

TODO describe this better

Method to be invoked to handle state change notifications

Return a reference to the Crossbeam Receiver to get Change notifications

Update the shared object using a closure.

The closure is passed a reference to the contents of the ZkState. Once the closure returns, the shared state in Zookeeper is committed and the write locks released.

Returns a Result<RwLockReadGuard>

Consistent Read.

Preforms a check to make sure the local version is the same as the remote version before returning. If there is a mismatch, will preform a sync and return the latest object

Dirty Read.

Returns the local data, not failing if the data is too old

Return the ID of this ZkState instance

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.