pub struct GatewayRoute { /* private fields */ }Expand description
Routing, load-balancing, retry, and rate-limit definition for one gateway prefix.
Implementations§
Source§impl GatewayRoute
Inherent implementation of GatewayRoute.
impl GatewayRoute
Inherent implementation of GatewayRoute.
Sourcepub fn new<P>(prefix: P, upstreams: Vec<UpstreamTarget>) -> Self
pub fn new<P>(prefix: P, upstreams: Vec<UpstreamTarget>) -> Self
Creates a new GatewayRoute matching prefix and forwarding to upstreams.
§Arguments
P- Path prefix convertible intoString.Vec<UpstreamTarget>- Upstream backend pool for this route.
§Returns
Self- Route with default round-robin balancing and 10 s timeout.
Sourcepub fn with_strip_prefix(self, strip_prefix: bool) -> Self
pub fn with_strip_prefix(self, strip_prefix: bool) -> Self
Sourcepub fn with_strategy(self, strategy: LoadBalanceStrategy) -> Self
pub fn with_strategy(self, strategy: LoadBalanceStrategy) -> Self
Sourcepub fn with_rate_limit(self, rate_limit: RateLimitConfig) -> Self
pub fn with_rate_limit(self, rate_limit: RateLimitConfig) -> Self
Source§impl GatewayRoute
impl GatewayRoute
pub fn get_prefix(&self) -> &String
pub fn get_mut_prefix(&mut self) -> &mut String
pub fn set_prefix(&mut self, val: String) -> &mut Self
pub fn get_strip_prefix(&self) -> bool
pub fn get_mut_strip_prefix(&mut self) -> &mut bool
pub fn set_strip_prefix(&mut self, val: bool) -> &mut Self
pub fn get_host(&self) -> Option<String>
pub fn try_get_host(&self) -> Option<String>
pub fn get_mut_host(&mut self) -> &mut Option<String>
pub fn set_host(&mut self, val: Option<String>) -> &mut Self
pub fn get_upstreams(&self) -> &Vec<UpstreamTarget>
pub fn get_mut_upstreams(&mut self) -> &mut Vec<UpstreamTarget>
pub fn set_upstreams(&mut self, val: Vec<UpstreamTarget>) -> &mut Self
pub fn get_strategy(&self) -> LoadBalanceStrategy
pub fn get_mut_strategy(&mut self) -> &mut LoadBalanceStrategy
pub fn set_strategy(&mut self, val: LoadBalanceStrategy) -> &mut Self
pub fn get_timeout_ms(&self) -> u64
pub fn get_mut_timeout_ms(&mut self) -> &mut u64
pub fn set_timeout_ms(&mut self, val: u64) -> &mut Self
pub fn get_max_retries(&self) -> usize
pub fn get_mut_max_retries(&mut self) -> &mut usize
pub fn set_max_retries(&mut self, val: usize) -> &mut Self
pub fn get_rate_limit(&self) -> Option<RateLimitConfig>
pub fn try_get_rate_limit(&self) -> Option<RateLimitConfig>
pub fn get_mut_rate_limit(&mut self) -> &mut Option<RateLimitConfig>
pub fn set_rate_limit(&mut self, val: Option<RateLimitConfig>) -> &mut Self
pub fn get_use_http2(&self) -> bool
pub fn get_mut_use_http2(&mut self) -> &mut bool
pub fn set_use_http2(&mut self, val: bool) -> &mut Self
Trait Implementations§
Source§impl Clone for GatewayRoute
impl Clone for GatewayRoute
Source§impl Debug for GatewayRoute
impl Debug for GatewayRoute
impl Eq for GatewayRoute
Source§impl PartialEq for GatewayRoute
impl PartialEq for GatewayRoute
impl StructuralPartialEq for GatewayRoute
Auto Trait Implementations§
impl Forget for GatewayRoute
impl Freeze for GatewayRoute
impl Move for GatewayRoute
impl RefUnwindSafe for GatewayRoute
impl Send for GatewayRoutewhere
RawVecInner: Send,
impl Sync for GatewayRoutewhere
RawVecInner: Sync,
impl Unpin for GatewayRoute
impl UnsafeUnpin for GatewayRoutewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<UpstreamTarget>: UnsafeUnpin,
impl UnwindSafe for GatewayRoutewhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.