pub struct GCEMetadata { /* private fields */ }Expand description
Get instance service account token from GCE instance
Get token from google cloud engine instance metadata. By default from url: http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token“
Example:
use ydb::GCEMetadata;
let cred = GCEMetadata::new();Implementations§
Source§impl GCEMetadata
impl GCEMetadata
Sourcepub fn from_url<T: Into<String>>(url: T) -> YdbResult<Self>
pub fn from_url<T: Into<String>>(url: T) -> YdbResult<Self>
Create GCEMetadata with custom url (may need for debug or spec infrastructure with non standard metadata)
Example:
use ydb::GCEMetadata;
let cred = GCEMetadata::from_url("http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token")?;Trait Implementations§
Source§impl Credentials for GCEMetadata
impl Credentials for GCEMetadata
fn create_token(&self) -> YdbResult<TokenInfo>
fn debug_string(&self) -> String
Auto Trait Implementations§
impl Freeze for GCEMetadata
impl RefUnwindSafe for GCEMetadata
impl Send for GCEMetadata
impl Sync for GCEMetadata
impl Unpin for GCEMetadata
impl UnwindSafe for GCEMetadata
Blanket Implementations§
Source§impl<T> Any for T
impl<T> Any for T
Source§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request