pub struct OpenAIChatGptAuthHandle { /* private fields */ }Expand description
Runtime auth state shared by OpenAI provider instances.
Implementations§
Source§impl OpenAIChatGptAuthHandle
impl OpenAIChatGptAuthHandle
pub fn new( session: OpenAIChatGptSession, auth_config: OpenAIAuthConfig, storage_mode: AuthCredentialsStoreMode, ) -> Self
pub fn new_external( session: OpenAIChatGptSession, auto_refresh: bool, refresher: Arc<dyn OpenAIChatGptSessionRefresher>, ) -> Self
pub fn snapshot(&self) -> Result<OpenAIChatGptSession>
pub fn current_api_key(&self) -> Result<String>
pub fn provider_label(&self) -> &'static str
pub async fn refresh_if_needed(&self) -> Result<()>
pub async fn force_refresh(&self) -> Result<()>
Trait Implementations§
Source§impl Clone for OpenAIChatGptAuthHandle
impl Clone for OpenAIChatGptAuthHandle
Auto Trait Implementations§
impl !RefUnwindSafe for OpenAIChatGptAuthHandle
impl !UnwindSafe for OpenAIChatGptAuthHandle
impl Forget for OpenAIChatGptAuthHandle
impl Freeze for OpenAIChatGptAuthHandlewhere
*const ArcInner<Mutex<OpenAIChatGptSession>> is !null: Freeze,
PhantomData<ArcInner<Mutex<OpenAIChatGptSession>>>: Freeze,
*const ArcInner<Mutex<()>> is !null: Freeze,
PhantomData<ArcInner<Mutex<()>>>: Freeze,
*const ArcInner<dyn OpenAIChatGptSessionRefresher> is !null: Freeze,
PhantomData<ArcInner<dyn OpenAIChatGptSessionRefresher>>: Freeze,
impl Move for OpenAIChatGptAuthHandle
impl Send for OpenAIChatGptAuthHandle
impl Sync for OpenAIChatGptAuthHandle
impl Unpin for OpenAIChatGptAuthHandle
impl UnsafeUnpin for OpenAIChatGptAuthHandlewhere
*const ArcInner<Mutex<OpenAIChatGptSession>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<OpenAIChatGptSession>>>: UnsafeUnpin,
*const ArcInner<Mutex<()>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<()>>>: UnsafeUnpin,
*const ArcInner<dyn OpenAIChatGptSessionRefresher> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn OpenAIChatGptSessionRefresher>>: UnsafeUnpin,
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