pub struct RequestBuilder { /* private fields */ }Expand description
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
Sourcepub fn url(self, url: impl IntoUrl) -> Self
pub fn url(self, url: impl IntoUrl) -> Self
Sets the request URL. Required; the scheme must be https.
Sourcepub fn header<K, V>(self, key: K, value: V) -> Selfwhere
K: TryInto<HeaderName>,
K::Error: Into<Error>,
V: TryInto<HeaderValue>,
V::Error: Into<Error>,
pub fn header<K, V>(self, key: K, value: V) -> Selfwhere
K: TryInto<HeaderName>,
K::Error: Into<Error>,
V: TryInto<HeaderValue>,
V::Error: Into<Error>,
Appends a header.
Sourcepub fn body(self, body: impl Into<Bytes>) -> Self
pub fn body(self, body: impl Into<Bytes>) -> Self
Sets the request body. Bodies are buffered; they are sent in full and can be replayed if connection establishment has to be repeated.
Sourcepub fn target(self, addr: ScionIpAddr) -> Self
pub fn target(self, addr: ScionIpAddr) -> Self
Bypasses DNS resolution: connect to addr, as if resolution had
returned exactly this address. The address carries no port — the port
always comes from the URL. The URL’s host remains the server name for SNI
and certificate validation.
This is the one-element case of targets.
Sourcepub fn targets(self, addrs: Vec<ScionIpAddr>) -> Self
pub fn targets(self, addrs: Vec<ScionIpAddr>) -> Self
Supplies the result of a resolution the caller performed itself:
connect to any of addrs, as if DNS had returned exactly this list.
The caller asserts the addresses are equivalent servers for the URL’s
origin; certificate validation against the URL’s host enforces it.
Like target, the addresses carry no port. The list
is sorted and de-duplicated, so element order does not affect
connection reuse. It must not be empty.
Sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Overrides the client’s request timeout for this request.
One deadline covering establishment, the response head, and body
collection; raise it for a response the caller will not collect right
away (see Response).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RequestBuilder
impl !RefUnwindSafe for RequestBuilder
impl !UnwindSafe for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin for RequestBuilder
impl UnsafeUnpin for RequestBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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 more