pub struct Locations { /* private fields */ }Expand description
Implements a client for the Cloud Metadata API.
§Service Description
An abstract interface that provides location-related information for a service. Service-specific metadata is provided through the Location.metadata field.
§Configuration
Locations has various configuration parameters, the defaults should
work with most applications.
§Pooling and Cloning
Locations holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap Locations in
an Rc or Arc to reuse it, because it already uses an Arc
internally.
Implementations§
Source§impl Locations
impl Locations
Sourcepub async fn new_with_config(conf: ClientConfig) -> Result<Self>
pub async fn new_with_config(conf: ClientConfig) -> Result<Self>
Creates a new client with the specified configuration.
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: Locations + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: Locations + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is when mocking the client.
Sourcepub fn list_locations(&self, name: impl Into<String>) -> ListLocations
pub fn list_locations(&self, name: impl Into<String>) -> ListLocations
Lists information about the supported locations for this service.
Sourcepub fn get_location(&self, name: impl Into<String>) -> GetLocation
pub fn get_location(&self, name: impl Into<String>) -> GetLocation
Gets information about a location.