Struct yar_client::Builder
[−]
[src]
pub struct Builder { /* fields omitted */ }
Methods
impl<'a> Builder
[src]
pub fn set_url(self, url: &str) -> Result<Builder>
[src]
Set Yar Api address http or https only
pub fn set_opt<T>(self, name: u8, value: T) -> Result<Builder> where
T: Sized + ToString,
[src]
T: Sized + ToString,
Set Request Options
- [x] YAR_OPT_PACKAGER :JSON 、MsgPack、PHP , the msg body encoding method.
- [ ] YAR_OPT_PERSISTENT , Temporarily not supported
- [x] YAR_OPT_TIMEOUT unit second , transport timeout
- [x] YAR_OPT_CONNECT_TIMEOUT unit second ,TCP connect timeout
pub fn set_provider(self, provider: &str) -> Builder
[src]
Set yar client Provider name, Default : yar_client_rust If provider's length long than 32 bytes, It will be truncated
pub fn set_token(self, token: &str) -> Builder
[src]
Set yar client Token name, Default : yar_client_rust If provider's length long than 32 bytes, It will be truncated
pub fn build(self) -> Result<YarClient>
[src]
Build a new YarClient ,Transport with curl
use yar_client::Builder; use yar_client::YAR_OPT_PACKAGER; Builder::default() .set_url("http://10limi.com/rpc.php").unwrap() .set_opt(YAR_OPT_PACKAGER,"JSON").unwrap().build();