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.
Auto Trait Implementations§
impl Freeze for YahooAuthManager
impl !RefUnwindSafe for YahooAuthManager
impl Send for YahooAuthManager
impl Sync for YahooAuthManager
impl Unpin for YahooAuthManager
impl !UnwindSafe 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