#[non_exhaustive]pub struct TrafficTarget {
pub type: TrafficTargetAllocationType,
pub revision: String,
pub percent: i32,
pub tag: String,
/* private fields */
}Expand description
Holds a single traffic routing entry for the Service. Allocations can be done to a specific Revision name, or pointing to the latest Ready Revision.
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.type: TrafficTargetAllocationTypeThe allocation type for this traffic target.
revision: StringRevision to which to send this portion of traffic, if traffic allocation is by revision.
percent: i32Specifies percent of the traffic to this Revision. This defaults to zero if unspecified.
tag: StringIndicates a string to be part of the URI to exclusively reference this target.
Implementations§
Source§impl TrafficTarget
impl TrafficTarget
pub fn new() -> Self
Sourcepub fn set_type<T: Into<TrafficTargetAllocationType>>(self, v: T) -> Self
pub fn set_type<T: Into<TrafficTargetAllocationType>>(self, v: T) -> Self
Sourcepub fn set_revision<T: Into<String>>(self, v: T) -> Self
pub fn set_revision<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_percent<T: Into<i32>>(self, v: T) -> Self
pub fn set_percent<T: Into<i32>>(self, v: T) -> Self
Trait Implementations§
Source§impl Clone for TrafficTarget
impl Clone for TrafficTarget
Source§fn clone(&self) -> TrafficTarget
fn clone(&self) -> TrafficTarget
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrafficTarget
impl Debug for TrafficTarget
Source§impl Default for TrafficTarget
impl Default for TrafficTarget
Source§fn default() -> TrafficTarget
fn default() -> TrafficTarget
Returns the “default value” for a type. Read more
Source§impl Message for TrafficTarget
impl Message for TrafficTarget
Source§impl PartialEq for TrafficTarget
impl PartialEq for TrafficTarget
impl StructuralPartialEq for TrafficTarget
Auto Trait Implementations§
impl Freeze for TrafficTarget
impl RefUnwindSafe for TrafficTarget
impl Send for TrafficTarget
impl Sync for TrafficTarget
impl Unpin for TrafficTarget
impl UnwindSafe for TrafficTarget
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
Mutably borrows from an owned value. Read more