pub struct YahooAuthManager { /* private fields */ }Expand description
Manages Yahoo Finance authentication (cookies and crumb).
Yahoo Finance requires a valid crumb token for API requests. This manager handles obtaining and refreshing the crumb automatically.
Implementations§
Source§impl YahooAuthManager
impl YahooAuthManager
Sourcepub fn new(proxy: Option<String>, cookie_jar: Arc<Jar>) -> Self
pub fn new(proxy: Option<String>, cookie_jar: Arc<Jar>) -> Self
Create a new YahooAuthManager.
§Arguments
proxy- Optional proxy URL for authentication requestscookie_jar- Shared cookie jar for storing session cookies
Sourcepub async fn refresh(&self) -> Result<(), YahooError>
pub async fn refresh(&self) -> Result<(), YahooError>
Force refresh the authentication credentials.
Sourcepub async fn get_or_refresh(&self) -> Result<(Arc<Jar>, String), YahooError>
pub async fn get_or_refresh(&self) -> Result<(Arc<Jar>, String), YahooError>
Get the current crumb, refreshing if necessary.
Returns a tuple of (cookie_jar, crumb) for use in API requests.
Sourcepub async fn switch_strategy_and_refresh(&self) -> Result<(), YahooError>
pub async fn switch_strategy_and_refresh(&self) -> Result<(), YahooError>
Force a strategy flip and refresh credentials. Used when Yahoo responds with generic 4xx indicating a potentially bad crumb, mirroring yfinance’s “retry with other cookie strategy” behavior.
Auto Trait Implementations§
impl !RefUnwindSafe for YahooAuthManager
impl !UnwindSafe for YahooAuthManager
impl Freeze for YahooAuthManager
impl Send for YahooAuthManager
impl Sync for YahooAuthManager
impl Unpin for YahooAuthManager
impl UnsafeUnpin for YahooAuthManager
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