pub struct Account {
pub id: String,
/* private fields */
}Expand description
Cloudflare account credentials used by Flarer.
The API token is wrapped in SecretString so it is not leaked through
Debug output or accidental logging.
Fields§
§id: StringCloudflare account ID (CF_ACCOUNT_ID).
Implementations§
Source§impl Account
impl Account
Sourcepub fn new(id: impl Into<String>, token: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, token: impl Into<String>) -> Self
Build an Account from an account id and API token.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Build an Account from the CF_ACCOUNT_ID and CF_API_TOKEN
environment variables.
Returns crate::FlarerError::Config if either variable is missing
or empty.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Account
impl<'de> Deserialize<'de> for Account
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Account
impl RefUnwindSafe for Account
impl Send for Account
impl Sync for Account
impl Unpin for Account
impl UnsafeUnpin for Account
impl UnwindSafe for Account
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