pub struct Client {
pub token: Option<String>,
pub repo: Option<String>,
/* private fields */
}Fields§
§token: Option<String>§repo: Option<String>Implementations§
Source§impl Client
impl Client
Sourcepub fn connect(path: &Path) -> Result<Self>
pub fn connect(path: &Path) -> Result<Self>
Connects to the daemon this machine trusts. There is no way to get a client without the check: a token goes nowhere unverified.
pub fn connect_to(path: &Path, trust: &Trust) -> Result<Self>
Sourcepub fn set_timeout(&mut self, timeout: Option<Duration>) -> Result<()>
pub fn set_timeout(&mut self, timeout: Option<Duration>) -> Result<()>
How long a request may take to be sent and answered; None (the
default) waits as long as the daemon does. Mind log’s wait_ms.
Past it the call fails with timed_out and the connection is
dropped: the request may have run.
pub fn timeout(&self) -> Option<Duration>
pub fn call(&mut self, method: &str, params: Value) -> Result<Value, CallError>
pub fn call_as<T: DeserializeOwned>( &mut self, method: &str, params: Value, ) -> Result<T, CallError>
Sourcepub fn watch(&mut self, watch: &Watch) -> Result<Watched, CallError>
pub fn watch(&mut self, watch: &Watch) -> Result<Watched, CallError>
events.watch with the human session this client carries: what
happened to its agents’ sessions, held up to watch.wait_ms while
nothing did. Go on with watch.after(&answer). A client timeout
(Client::set_timeout) must be longer than the wait.
Auto Trait Implementations§
impl Forget for Client
impl Freeze for Client
impl Move for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more