pub struct TargetLayer { /* private fields */ }Available on crate feature
client only.Expand description
Set a Target as the destination forcely.
The layer only sets destination address, including target address, target domain name (for DNS) and SNI of target host (if using HTTPS).
Note that this layer MUST be set as an outer layer because outer layers runs before service discover (DNS).
Implementations§
Source§impl TargetLayer
impl TargetLayer
Sourcepub const fn new(target: Target) -> Self
pub const fn new(target: Target) -> Self
Create a TargetLayer via a Target.
This layer will set the Target as request destination.
Sourcepub fn new_address<A>(addr: A) -> Self
pub fn new_address<A>(addr: A) -> Self
Create a TargetLayer via an address.
Sourcepub fn new_host<S>(host: S) -> Self
pub fn new_host<S>(host: S) -> Self
Create a TargetLayer via a host name.
Sourcepub fn with_service_name<S>(self, service_name: S) -> Self
pub fn with_service_name<S>(self, service_name: S) -> Self
Set a service name for current TargetLayer.
When this layer sets Target as the destination, the service name is also set, and if the
request uses HTTPS, the service name will be used as the SNI.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TargetLayer
impl RefUnwindSafe for TargetLayer
impl Send for TargetLayer
impl Sync for TargetLayer
impl Unpin for TargetLayer
impl UnwindSafe for TargetLayer
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