Struct spacegate_model::http_route::SgBackendRef
source · pub struct SgBackendRef<P = PluginInstanceId> {
pub host: BackendHost,
pub port: Option<u16>,
pub timeout_ms: Option<u32>,
pub protocol: Option<SgBackendProtocol>,
pub weight: Option<u16>,
pub plugins: Vec<P>,
}Expand description
BackendRef defines how a HTTPRoute should forward an HTTP request.
Fields§
§host: BackendHost§port: Option<u16>Port specifies the destination port number to use for this resource.
timeout_ms: Option<u32>Timeout specifies the timeout for requests forwarded to the referenced backend.
protocol: Option<SgBackendProtocol>§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.
plugins: Vec<P>plugins define the filters that are applied to backend that match this hostnames.
§Notice!
this field is ordered, the first plugin will be the outermost plugin.
Implementations§
source§impl<P> SgBackendRef<P>
impl<P> SgBackendRef<P>
pub fn map_plugins<F, T>(self, f: F) -> SgBackendRef<T>where
F: FnMut(P) -> T,
Trait Implementations§
source§impl<P: Clone> Clone for SgBackendRef<P>
impl<P: Clone> Clone for SgBackendRef<P>
source§fn clone(&self) -> SgBackendRef<P>
fn clone(&self) -> SgBackendRef<P>
Returns a copy 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<P: Debug> Debug for SgBackendRef<P>
impl<P: Debug> Debug for SgBackendRef<P>
source§impl<P> Default for SgBackendRef<P>
impl<P> Default for SgBackendRef<P>
source§impl<'de, P> Deserialize<'de> for SgBackendRef<P>
impl<'de, P> Deserialize<'de> for SgBackendRef<P>
source§fn 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
Auto Trait Implementations§
impl<P> Freeze for SgBackendRef<P>
impl<P> RefUnwindSafe for SgBackendRef<P>where
P: RefUnwindSafe,
impl<P> Send for SgBackendRef<P>where
P: Send,
impl<P> Sync for SgBackendRef<P>where
P: Sync,
impl<P> Unpin for SgBackendRef<P>where
P: Unpin,
impl<P> UnwindSafe for SgBackendRef<P>where
P: UnwindSafe,
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