pub struct Auth { /* private fields */ }Expand description
LOW-auth credentials for Internet Archive programmatic access.
Implementations§
Source§impl Auth
impl Auth
Sourcepub const ACCESS_KEY_ENV_VAR: &'static str = "INTERNET_ARCHIVE_ACCESS_KEY"
pub const ACCESS_KEY_ENV_VAR: &'static str = "INTERNET_ARCHIVE_ACCESS_KEY"
Standard environment variable for the S3 access key.
Sourcepub const SECRET_KEY_ENV_VAR: &'static str = "INTERNET_ARCHIVE_SECRET_KEY"
pub const SECRET_KEY_ENV_VAR: &'static str = "INTERNET_ARCHIVE_SECRET_KEY"
Standard environment variable for the S3 secret key.
Sourcepub fn new(access_key: impl Into<String>, secret_key: impl Into<String>) -> Self
pub fn new(access_key: impl Into<String>, secret_key: impl Into<String>) -> Self
Creates a new auth pair.
Sourcepub fn from_env() -> Result<Self, InternetArchiveError>
pub fn from_env() -> Result<Self, InternetArchiveError>
Reads credentials from the standard environment variables.
§Errors
Returns an error if either environment variable is missing.
Sourcepub fn from_env_vars(
access_name: &str,
secret_name: &str,
) -> Result<Self, InternetArchiveError>
pub fn from_env_vars( access_name: &str, secret_name: &str, ) -> Result<Self, InternetArchiveError>
Reads credentials from custom environment variables.
§Errors
Returns an error if either environment variable is missing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Auth
impl RefUnwindSafe for Auth
impl Send for Auth
impl Sync for Auth
impl Unpin for Auth
impl UnsafeUnpin for Auth
impl UnwindSafe for Auth
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