MCPcopy Create free account
hub / github.com/0x676e67/wreq-python / extract_bound

Method extract_bound

src/client/typing/proxy.rs:116–128  ·  view source on GitHub ↗
(ob: &Bound<'_, PyAny>)

Source from the content-addressed store, hash-verified

114
115impl FromPyObject<'_> for ProxyExtractor {
116 fn extract_bound(ob: &Bound<'_, PyAny>) -> PyResult<Self> {
117 if let Ok(proxy_str) = ob.extract::<PyBackedStr>() {
118 let proxy = wreq::Proxy::all(proxy_str.as_ref() as &str)
119 .map(Self)
120 .map_err(Error::Request)?;
121
122 return Ok(proxy);
123 }
124
125 let proxy = ob.downcast::<Proxy>()?;
126 let proxy = proxy.borrow().0.clone();
127 Ok(Self(proxy))
128 }
129}
130
131pub struct ProxyListExtractor(pub Vec<wreq::Proxy>);

Callers

nothing calls this directly

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected