cloud_sdk/operation/prepared/
service.rs1use crate::transport::EndpointPolicy;
4use crate::{ProviderId, ProviderMarker, ServiceId, ServiceMarker};
5
6#[derive(Clone, Copy, Debug, Eq, PartialEq)]
8pub struct ProviderService<'endpoint> {
9 provider_id: ProviderId,
10 service_id: ServiceId,
11 endpoint_policy: EndpointPolicy<'endpoint>,
12}
13
14impl<'endpoint> ProviderService<'endpoint> {
15 #[must_use]
17 pub const fn new(
18 provider_id: ProviderId,
19 service_id: ServiceId,
20 endpoint_policy: EndpointPolicy<'endpoint>,
21 ) -> Self {
22 Self {
23 provider_id,
24 service_id,
25 endpoint_policy,
26 }
27 }
28
29 #[must_use]
31 pub const fn from_marker<S: ServiceMarker>(endpoint_policy: EndpointPolicy<'endpoint>) -> Self {
32 Self::new(<S::Provider as ProviderMarker>::ID, S::ID, endpoint_policy)
33 }
34
35 #[must_use]
37 pub const fn provider_id(self) -> ProviderId {
38 self.provider_id
39 }
40
41 #[must_use]
43 pub const fn service_id(self) -> ServiceId {
44 self.service_id
45 }
46
47 #[must_use]
49 pub const fn endpoint_policy(self) -> EndpointPolicy<'endpoint> {
50 self.endpoint_policy
51 }
52}