pub struct Config {
pub client_id: String,
pub client_secret: String,
pub url: String,
pub upload_url: String,
pub access_token: Option<String>,
}Expand description
PDD的授权信息,参考
Fields§
§client_id: Stringclient_id
client_secret: Stringclient_secret
url: String拼多多的api请求地址
upload_url: String文件上传的请求地址
access_token: Option<String>获取到的access_token
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env() -> Result<Self, Error>
pub fn from_env() -> Result<Self, Error>
从环境变量获取Config
§Powershell:
$env:PDD_CLIENT_ID = "clientidabaaba"$env:PDD_CLIENT_SECRET = "clientsecretabaaba"$env:PDD_URL = "https://gw-api.pinduoduo.com/api/router"$env:PDD_ACCESS_TOKEN = "pdd_access_tokenabaabaaba"
§Bash:
export PDD_CLIENT_ID="clientidabaaba"export PDD_CLIENT_SECRET="clientsecretabaaba"export PDD_URL="https://gw-api.pinduoduo.com/api/router"export PDD_ACCESS_TOKEN="pdd_access_tokenabaabaaba"
§Examples
let config = Config::from_env();
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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