Struct k8s_gateway_api::BackendRef
source · [−]pub struct BackendRef {
pub weight: Option<u16>,
pub name: String,
pub port: PortNumber,
}
Expand description
BackendRef defines how a Route should forward a request to a Kubernetes resource.
Note that when a namespace is specified, a ReferencePolicy object is required in the referent namespace to allow that namespace’s owner to accept the reference. See the ReferencePolicy documentation for details.
Fields
weight: Option<u16>
Weight specifies the proportion of requests forwarded to the referenced backend. This is computed as weight/(sum of all weights in this BackendRefs list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100.
If only one backend is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weight is set to 0, no traffic should be forwarded for this entry. If unspecified, weight defaults to 1.
Support for this field varies based on the context where used.
name: String
port: PortNumber
Trait Implementations
sourceimpl Clone for BackendRef
impl Clone for BackendRef
sourcefn clone(&self) -> BackendRef
fn clone(&self) -> BackendRef
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BackendRef
impl Debug for BackendRef
sourceimpl<'de> Deserialize<'de> for BackendRef
impl<'de> Deserialize<'de> for BackendRef
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl JsonSchema for BackendRef
impl JsonSchema for BackendRef
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
sourcefn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the $ref
keyword. Read more
sourceimpl PartialEq<BackendRef> for BackendRef
impl PartialEq<BackendRef> for BackendRef
sourcefn eq(&self, other: &BackendRef) -> bool
fn eq(&self, other: &BackendRef) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &BackendRef) -> bool
fn ne(&self, other: &BackendRef) -> bool
This method tests for !=
.
sourceimpl Serialize for BackendRef
impl Serialize for BackendRef
impl StructuralPartialEq for BackendRef
Auto Trait Implementations
impl RefUnwindSafe for BackendRef
impl Send for BackendRef
impl Sync for BackendRef
impl Unpin for BackendRef
impl UnwindSafe for BackendRef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more