pub struct Client {
pub addr: String,
pub codec: Codecs,
pub stub: ClientStub,
pub stream: RefCell<TcpStream>,
}Fields§
§addr: String§codec: Codecs§stub: ClientStub§stream: RefCell<TcpStream>Implementations§
Source§impl Client
impl Client
pub fn dial(addr: &str) -> Result<Self>
Sourcepub fn set_timeout(self, timeout: Duration) -> Self
pub fn set_timeout(self, timeout: Duration) -> Self
set timeout,default is 60s
Sourcepub fn get_timeout(&self) -> &Duration
pub fn get_timeout(&self) -> &Duration
get timeout,default is 60s
pub fn call<Arg, Resp>(&self, func: &str, arg: Arg) -> Result<Resp>where
Arg: Serialize,
Resp: DeserializeOwned,
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl !Sync for Client
impl Unpin 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