Struct junction_api::VirtualHost
source · pub struct VirtualHost {
pub target: Target,
pub port: Option<u16>,
}
Expand description
A virtual hostname. VirtualHosts
represent the primary layer of
indirection in Junction. Traffic sent to a VirtualHost
is routed to an
appropriate backend based on the content of the request.
VirtualHosts uniquely map to the Authority section of a URL.
Fields§
§target: Target
The logical target for this traffic.
port: Option<u16>
The port this virtual hostname should apply to. If no port is specified, traffic is allowed on any port.
Implementations§
source§impl VirtualHost
impl VirtualHost
sourcepub fn with_port(&self, port: u16) -> Self
pub fn with_port(&self, port: u16) -> Self
Return a clone of this target with its port set to port
.
sourcepub fn without_port(&self) -> Self
pub fn without_port(&self) -> Self
Return a clone of this virtual host with no port set.
sourcepub fn with_default_port(&self, default_port: u16) -> Self
pub fn with_default_port(&self, default_port: u16) -> Self
Return a clone of this VirtualHost with its port set to default_port
if it doesn’t already have a port set.
sourcepub fn into_backend(self) -> Option<BackendId>
pub fn into_backend(self) -> Option<BackendId>
Clone this VirtualHost and convert it to a BackendId.
Returns None
if this VirtualHost has no port set.
Trait Implementations§
source§impl Clone for VirtualHost
impl Clone for VirtualHost
source§fn clone(&self) -> VirtualHost
fn clone(&self) -> VirtualHost
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 Debug for VirtualHost
impl Debug for VirtualHost
source§impl<'de> Deserialize<'de> for VirtualHost
impl<'de> Deserialize<'de> for VirtualHost
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
source§impl Display for VirtualHost
impl Display for VirtualHost
source§impl FromStr for VirtualHost
impl FromStr for VirtualHost
source§impl Hash for VirtualHost
impl Hash for VirtualHost
source§impl Ord for VirtualHost
impl Ord for VirtualHost
source§fn cmp(&self, other: &VirtualHost) -> Ordering
fn cmp(&self, other: &VirtualHost) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for VirtualHost
impl PartialEq for VirtualHost
source§impl PartialOrd for VirtualHost
impl PartialOrd for VirtualHost
source§impl Serialize for VirtualHost
impl Serialize for VirtualHost
source§impl TryFrom<&HTTPRouteParentRefs> for VirtualHost
impl TryFrom<&HTTPRouteParentRefs> for VirtualHost
source§impl TryFrom<&VirtualHost> for HTTPRouteParentRefs
impl TryFrom<&VirtualHost> for HTTPRouteParentRefs
impl Eq for VirtualHost
impl StructuralPartialEq for VirtualHost
Auto Trait Implementations§
impl Freeze for VirtualHost
impl RefUnwindSafe for VirtualHost
impl Send for VirtualHost
impl Sync for VirtualHost
impl Unpin for VirtualHost
impl UnwindSafe for VirtualHost
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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>
Converts
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>
Converts
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>
Wrap the input message
T
in a tonic::Request