Struct dscfg_client::Client
source · pub struct Client<C> { /* private fields */ }
Expand description
DSCFG client
This represents a connection to the DSCFG server and allows manipulating shared configurationn as well as receiving notifictions about changes.
You should usually create it by calling new()
function of this crate,
but you may use custom stream if you need finer control.
Implementations§
source§impl<Val: Serialize + for<'a> Deserialize<'a>, E, C: Stream<Item = Response<Val>, Error = E> + Sink<SinkItem = Request<Val>, SinkError = E>> Client<C>
impl<Val: Serialize + for<'a> Deserialize<'a>, E, C: Stream<Item = Response<Val>, Error = E> + Sink<SinkItem = Request<Val>, SinkError = E>> Client<C>
sourcepub fn set_value(
self,
key: String,
value: Val
) -> impl Future<Item = Self, Error = E>
pub fn set_value(
self,
key: String,
value: Val
) -> impl Future<Item = Self, Error = E>
Sends request to set the key
to given value
.
Returns future which resolves to Client
, if the request succeeded.
sourcepub fn get_value<K: Into<String>>(
self,
key: K
) -> impl Future<Item = (Val, Self), Error = ProtocolError<E>>
pub fn get_value<K: Into<String>>(
self,
key: K
) -> impl Future<Item = (Val, Self), Error = ProtocolError<E>>
Sends request for getting value of given key and waits for the answer.
Returns future which resolves to (Val, Self)
if successful.