pub struct MetadataUrlCredentials { /* private fields */ }Expand description
Get token of service account of instance
Yandex cloud support GCE token compatible. Use it. Example:
use ydb::MetadataUrlCredentials;
let cred = MetadataUrlCredentials::new();Implementations§
Source§impl MetadataUrlCredentials
impl MetadataUrlCredentials
pub fn new() -> Self
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::MetadataUrlCredentials;
let cred = MetadataUrlCredentials::from_url("http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token")?;Trait Implementations§
Source§impl Credentials for MetadataUrlCredentials
impl Credentials for MetadataUrlCredentials
fn create_token(&self) -> YdbResult<TokenInfo>
fn debug_string(&self) -> String
Auto Trait Implementations§
impl Freeze for MetadataUrlCredentials
impl RefUnwindSafe for MetadataUrlCredentials
impl Send for MetadataUrlCredentials
impl Sync for MetadataUrlCredentials
impl Unpin for MetadataUrlCredentials
impl UnwindSafe for MetadataUrlCredentials
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