pub struct Vault { /* private fields */ }Implementations§
Source§impl Vault
impl Vault
pub fn open(dir: PathBuf) -> Result<Self>
pub async fn list(&self) -> Vec<Account>
pub fn set_policies_blocking(&self, policies: Vec<(Provider, AccountPolicy)>)
pub async fn set_policies(&self, policies: Vec<(Provider, AccountPolicy)>)
pub fn policy(&self, provider: Provider) -> AccountPolicy
pub async fn set_policy_persisted( &self, provider: Provider, policy: AccountPolicy, ) -> Result<()>
pub async fn record_codex_limits(&self, id: &str, snapshot: Value) -> Result<()>
pub async fn pause( &self, provider: Provider, name: &str, paused: bool, ) -> Result<()>
pub async fn set_paused(&self, id: &str, paused: bool) -> Result<()>
pub async fn has_account_name(&self, provider: Provider, name: &str) -> bool
pub async fn upsert(&self, account: Account) -> Result<()>
pub async fn remove(&self, id: &str) -> Result<bool>
pub async fn account_for( &self, provider: Provider, prefer_oauth: bool, ) -> Result<Account>
pub async fn account_for_excluding( &self, provider: Provider, prefer_oauth: bool, excluded: &HashSet<String>, ) -> Result<Account>
Sourcepub async fn account_for_excluding_preferred(
&self,
provider: Provider,
prefer_oauth: bool,
excluded: &HashSet<String>,
preferred_id: Option<&str>,
) -> Result<Account>
pub async fn account_for_excluding_preferred( &self, provider: Provider, prefer_oauth: bool, excluded: &HashSet<String>, preferred_id: Option<&str>, ) -> Result<Account>
Select an account using the provider policy, while keeping an existing
conversation on preferred_id when that account is still usable.
A preferred account never bypasses pause/eligibility/cooldown or the caller’s exclusion set. This lets the proxy preserve prompt-cache affinity without defeating routing controls or retry failover.
pub async fn account_for_excluding_preferred_mode( &self, provider: Provider, prefer_oauth: bool, excluded: &HashSet<String>, preferred_id: Option<&str>, preferred_ignores_cooldown: bool, ) -> Result<Account>
pub async fn mark_cooldown(&self, id: &str, until_ms: i64) -> Result<()>
pub async fn refresh(&self, id: &str, force: bool) -> Result<Account>
pub async fn set_account_meta( &self, id: &str, key: &str, value: Value, ) -> Result<()>
Auto Trait Implementations§
impl !Freeze for Vault
impl !RefUnwindSafe for Vault
impl !UnwindSafe for Vault
impl Send for Vault
impl Sync for Vault
impl Unpin for Vault
impl UnsafeUnpin for Vault
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