pub struct LiveClient { /* private fields */ }Expand description
A client backed by adventofcode.com.
This type is the one place in the crate where the site is actually contacted, and - through the transport it holds - the one place where the rate of contact is enforced.
Implementations§
Source§impl LiveClient
impl LiveClient
Sourcepub fn new(
cookie: &str,
state_dir: impl Into<PathBuf>,
) -> Result<Self, ApiError>
pub fn new( cookie: &str, state_dir: impl Into<PathBuf>, ) -> Result<Self, ApiError>
Creates a client authenticated with the given session cookie, pacing its
requests using state kept in state_dir.
§Errors
Returns ApiError::Transport if the runtime cannot be started, or if
the cookie cannot be sent in a header.
Trait Implementations§
Source§impl AocClient for LiveClient
impl AocClient for LiveClient
Auto Trait Implementations§
impl !Freeze for LiveClient
impl !RefUnwindSafe for LiveClient
impl !Sync for LiveClient
impl !UnwindSafe for LiveClient
impl Send for LiveClient
impl Unpin for LiveClient
impl UnsafeUnpin for LiveClient
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