pub struct Proxy { /* private fields */ }Implementations§
Source§impl Proxy
impl Proxy
pub fn new( client: Client, wallet: Wallet, settings: Settings, opts: Options, ) -> Arc<Self> ⓘ
Sourcepub async fn refill(&self, now_: bool)
pub async fn refill(&self, now_: bool)
Keep the wallet and passes topped up from the account, in the background, so customers
never move money by hand. now: ask the account at once (the proxy starting, or a
person’s command); else only when the next contact is due, set at random each time
(CONTACT_SECS), so when the account is asked says nothing about any request.
Sourcepub async fn helper_secret(&self) -> Result<String>
pub async fn helper_secret(&self) -> Result<String>
The secret of the helper session, opening one if there is none or the
server has closed it. Agents that send it straight to the server
(Claude Code’s apiKeyHelper) ask again after a 401.
Sourcepub async fn watch_helper(&self)
pub async fn watch_helper(&self)
The helper session’s requests never pass through here, so watch its balance instead: a change means it is in use (not idle), and a low balance gets topped up before a request fails for want of money.
Sourcepub async fn close_idle(&self)
pub async fn close_idle(&self)
Close every session that has been quiet for idle_close.