pub struct ServiceDefinition {
pub service_name: String,
pub binary_path: String,
pub isolation: i32,
pub explicit_instance: String,
pub per_version_binary_dir: String,
pub min_version: String,
pub version_allow_list: Vec<String>,
pub labels: HashMap<String, String>,
pub http_server: Option<HttpServerCapability>,
}Expand description
v2 service definition envelope.
Carries the service identity, the launcher / isolation policy shared
with v1, and the new v2-only capability fields. The fields shared
with v1 (binary_path, isolation, etc.) intentionally use the same
field numbers as broker_v1.ServiceDefinition (2–8) to keep the
human-readable diff between the two messages obvious and to make
the v1 → v2 migration a literal field-by-field move on the consumer
side. New v2-only fields start at 10 (http_server) and grow upward.
Fields§
§service_name: String[a-z0-9-]{1,64}; same validation rules as v1.
binary_path: StringCanonical path to the backend binary. v1: binary_path (field 2).
Pre-#522 v2 brokers ignored this; consumers populating the field on
a pre-#522 broker get the v2 envelope round-trip but the broker
can’t launch from the path until upgraded.
isolation: i32Broker isolation mode. v1: BrokerIsolation (field 3). Defaults
to PRIVATE_BROKER (proto3 zero value) when absent.
explicit_instance: StringUsed only when isolation == EXPLICIT_INSTANCE. v1: explicit_instance
(field 4). Ignored for other isolation modes.
per_version_binary_dir: StringCanonicalized allow-list root for backends. v1: per_version_binary_dir
(field 5). The broker refuses any binary_path that does not resolve
under this directory.
min_version: StringSemver floor — broker refuses any Hello whose wanted_version is
below this. v1: min_version (field 6). Empty => no floor.
version_allow_list: Vec<String>Optional strict pin list. v1: version_allow_list (field 7). When
non-empty, the broker refuses any Hello whose wanted_version is
not in this list. Use sparingly — min_version is the common case.
labels: HashMap<String, String>Arbitrary key/value labels (deployment hints, A/B routing tags, …).
v1: labels (field 8). Broker does not interpret these; they are
surfaced verbatim to consumers via the existing reflection APIs.
http_server: Option<HttpServerCapability>Optional HTTP server capability. Absent => backend serves no HTTP. v2-only field; v1 has no HTTP-server concept.
Implementations§
Source§impl ServiceDefinition
impl ServiceDefinition
Sourcepub fn isolation(&self) -> BrokerIsolation
pub fn isolation(&self) -> BrokerIsolation
Returns the enum value of isolation, or the default if the field is set to an invalid enum value.
Sourcepub fn set_isolation(&mut self, value: BrokerIsolation)
pub fn set_isolation(&mut self, value: BrokerIsolation)
Sets isolation to the provided enum value.
Trait Implementations§
Source§impl Clone for ServiceDefinition
impl Clone for ServiceDefinition
Source§impl Debug for ServiceDefinition
impl Debug for ServiceDefinition
Source§impl Default for ServiceDefinition
impl Default for ServiceDefinition
Source§impl Message for ServiceDefinition
impl Message for ServiceDefinition
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.