pub struct Route {
pub id: Name,
pub tags: BTreeMap<String, String>,
pub hostnames: Vec<HostnameMatch>,
pub ports: Vec<u16>,
pub rules: Vec<RouteRule>,
}
Expand description
A Route is a policy that describes how a request to a specific virtual host should be routed.
Fields§
§id: Name
A globally unique identifier for this Route.
Route IDs must be valid RFC 1035 DNS label names - they must start with
a lowercase ascii character, and can only contain lowercase ascii
alphanumeric characters and the -
character.
A list of arbitrary tags that can be added to a Route.
hostnames: Vec<HostnameMatch>
The hostnames that match this Route.
ports: Vec<u16>
The ports that match this Route.
rules: Vec<RouteRule>
The rules that determine whether a request matches and where traffic should be routed.
Implementations§
Source§impl Route
impl Route
Sourcepub fn passthrough_route(id: Name, service: Service) -> Route
pub fn passthrough_route(id: Name, service: Service) -> Route
Create a trivial route that passes all traffic for a target directly to the given Service. The request port will be used to identify a specific backend at request time.
Source§impl Route
impl Route
Sourcepub fn from_gateway_httproute(httproute: &HTTPRoute) -> Result<Route, Error>
pub fn from_gateway_httproute(httproute: &HTTPRoute) -> Result<Route, Error>
Convert a Gateway API [HTTPRoute][gateway_http::HTTPRoute] into a Junction Route.
Sourcepub fn to_gateway_httproute(&self, namespace: &str) -> Result<HTTPRoute, Error>
pub fn to_gateway_httproute(&self, namespace: &str) -> Result<HTTPRoute, Error>
Convert this Route to a Gateway API [HTTPRoute][gateway_http::HTTPRoute].
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Route
impl<'de> Deserialize<'de> for Route
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>,
impl StructuralPartialEq for Route
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnwindSafe for Route
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request