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>
Auto Trait Implementations§
impl Forget for Client
impl Freeze 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