Struct Service

Source
#[non_exhaustive]
pub struct Service { pub name: String, pub display_name: String, pub basic_service: Option<BasicService>, pub telemetry: Option<Telemetry>, pub user_labels: HashMap<String, String>, pub identifier: Option<Identifier>, }
Expand description

A Service is a discrete, autonomous, and network-accessible unit, designed to solve an individual concern (Wikipedia). In Cloud Monitoring, a Service acts as the root resource under which operational aspects of the service are accessible.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Identifier. Resource name for this Service. The format is:

projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
§display_name: String

Name used for UI elements listing this Service.

§basic_service: Option<BasicService>

Message that contains the service type and service labels of this service if it is a basic service. Documentation and examples here.

§telemetry: Option<Telemetry>

Configuration for how to query telemetry on a Service.

§user_labels: HashMap<String, String>

Labels which have been used to annotate the service. Label keys must start with a letter. Label keys and values may contain lowercase letters, numbers, underscores, and dashes. Label keys and values have a maximum length of 63 characters, and must be less than 128 bytes in size. Up to 64 label entries may be stored. For labels which do not have a semantic value, the empty string may be supplied for the label value.

§identifier: Option<Identifier>

REQUIRED. Service-identifying atoms specifying the underlying service.

Implementations§

Source§

impl Service

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

Source

pub fn set_display_name<T: Into<String>>(self, v: T) -> Self

Sets the value of display_name.

Source

pub fn set_basic_service<T: Into<Option<BasicService>>>(self, v: T) -> Self

Sets the value of basic_service.

Source

pub fn set_telemetry<T: Into<Option<Telemetry>>>(self, v: T) -> Self

Sets the value of telemetry.

Source

pub fn set_user_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of user_labels.

Source

pub fn set_identifier<T: Into<Option<Identifier>>>(self, v: T) -> Self

Sets the value of identifier.

Source

pub fn get_custom(&self) -> Option<&Box<Custom>>

The value of identifier if it holds a Custom, None if the field is not set or holds a different branch.

Source

pub fn get_app_engine(&self) -> Option<&Box<AppEngine>>

The value of identifier if it holds a AppEngine, None if the field is not set or holds a different branch.

Source

pub fn get_cloud_endpoints(&self) -> Option<&Box<CloudEndpoints>>

The value of identifier if it holds a CloudEndpoints, None if the field is not set or holds a different branch.

Source

pub fn get_cluster_istio(&self) -> Option<&Box<ClusterIstio>>

The value of identifier if it holds a ClusterIstio, None if the field is not set or holds a different branch.

Source

pub fn get_mesh_istio(&self) -> Option<&Box<MeshIstio>>

The value of identifier if it holds a MeshIstio, None if the field is not set or holds a different branch.

Source

pub fn get_istio_canonical_service(&self) -> Option<&Box<IstioCanonicalService>>

The value of identifier if it holds a IstioCanonicalService, None if the field is not set or holds a different branch.

Source

pub fn get_cloud_run(&self) -> Option<&Box<CloudRun>>

The value of identifier if it holds a CloudRun, None if the field is not set or holds a different branch.

Source

pub fn get_gke_namespace(&self) -> Option<&Box<GkeNamespace>>

The value of identifier if it holds a GkeNamespace, None if the field is not set or holds a different branch.

Source

pub fn get_gke_workload(&self) -> Option<&Box<GkeWorkload>>

The value of identifier if it holds a GkeWorkload, None if the field is not set or holds a different branch.

Source

pub fn get_gke_service(&self) -> Option<&Box<GkeService>>

The value of identifier if it holds a GkeService, None if the field is not set or holds a different branch.

Source

pub fn set_custom<T: Into<Box<Custom>>>(self, v: T) -> Self

Sets the value of identifier to hold a Custom.

Note that all the setters affecting identifier are mutually exclusive.

Source

pub fn set_app_engine<T: Into<Box<AppEngine>>>(self, v: T) -> Self

Sets the value of identifier to hold a AppEngine.

Note that all the setters affecting identifier are mutually exclusive.

Source

pub fn set_cloud_endpoints<T: Into<Box<CloudEndpoints>>>(self, v: T) -> Self

Sets the value of identifier to hold a CloudEndpoints.

Note that all the setters affecting identifier are mutually exclusive.

Source

pub fn set_cluster_istio<T: Into<Box<ClusterIstio>>>(self, v: T) -> Self

Sets the value of identifier to hold a ClusterIstio.

Note that all the setters affecting identifier are mutually exclusive.

Source

pub fn set_mesh_istio<T: Into<Box<MeshIstio>>>(self, v: T) -> Self

Sets the value of identifier to hold a MeshIstio.

Note that all the setters affecting identifier are mutually exclusive.

Source

pub fn set_istio_canonical_service<T: Into<Box<IstioCanonicalService>>>( self, v: T, ) -> Self

Sets the value of identifier to hold a IstioCanonicalService.

Note that all the setters affecting identifier are mutually exclusive.

Source

pub fn set_cloud_run<T: Into<Box<CloudRun>>>(self, v: T) -> Self

Sets the value of identifier to hold a CloudRun.

Note that all the setters affecting identifier are mutually exclusive.

Source

pub fn set_gke_namespace<T: Into<Box<GkeNamespace>>>(self, v: T) -> Self

Sets the value of identifier to hold a GkeNamespace.

Note that all the setters affecting identifier are mutually exclusive.

Source

pub fn set_gke_workload<T: Into<Box<GkeWorkload>>>(self, v: T) -> Self

Sets the value of identifier to hold a GkeWorkload.

Note that all the setters affecting identifier are mutually exclusive.

Source

pub fn set_gke_service<T: Into<Box<GkeService>>>(self, v: T) -> Self

Sets the value of identifier to hold a GkeService.

Note that all the setters affecting identifier are mutually exclusive.

Trait Implementations§

Source§

impl Clone for Service

Source§

fn clone(&self) -> Service

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Service

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Service

Source§

fn default() -> Service

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Service

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Message for Service

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Service

Source§

fn eq(&self, other: &Service) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Service

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Service

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T