pub enum Adc {
Metadata(Metadata),
User(GcloudUser),
Static(Static),
}Expand description
Application Default Credentials (no private-key signing).
Variants§
Metadata(Metadata)
The instance metadata server.
User(GcloudUser)
gcloud user credentials.
Static(Static)
A fixed token.
Implementations§
Source§impl Adc
impl Adc
Sourcepub fn discover() -> Result<Self>
pub fn discover() -> Result<Self>
GOOGLE_APPLICATION_CREDENTIALS (user credentials), then gcloud’s
well-known file, then the metadata server
(discover_with under MetadataPolicy::Allow).
Sourcepub fn discover_with(metadata: MetadataPolicy) -> Result<Self>
pub fn discover_with(metadata: MetadataPolicy) -> Result<Self>
Discovery as discover, with the metadata server
allowed or forbidden.
Sourcepub fn from_access_token(secret: impl Into<String>) -> Result<Self>
pub fn from_access_token(secret: impl Into<String>) -> Result<Self>
A caller-supplied access token, used as is and never refreshed
(Adc::Static). An empty or blank token is
Error::NoCredentials: it would send unauthenticated requests.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Adc
impl !RefUnwindSafe for Adc
impl !UnwindSafe for Adc
impl Send for Adc
impl Sync for Adc
impl Unpin for Adc
impl UnsafeUnpin for Adc
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