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§fn clone(&self) -> ServiceDefinition
fn clone(&self) -> ServiceDefinition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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.Source§impl PartialEq for ServiceDefinition
impl PartialEq for ServiceDefinition
Source§fn eq(&self, other: &ServiceDefinition) -> bool
fn eq(&self, other: &ServiceDefinition) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ServiceDefinition
Auto Trait Implementations§
impl Freeze for ServiceDefinition
impl RefUnwindSafe for ServiceDefinition
impl Send for ServiceDefinition
impl Sync for ServiceDefinition
impl Unpin for ServiceDefinition
impl UnsafeUnpin for ServiceDefinition
impl UnwindSafe for ServiceDefinition
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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 more