pub struct GatewayRequest {
pub method: GatewayMethod,
pub path: GatewayPath,
pub accept: Option<String>,
pub range: Option<String>,
pub host: Option<String>,
pub query: HashMap<String, String>,
}Expand description
Gateway request information.
§Kubo Equivalent
Corresponds to request handling in boxo/gateway/handler.go.
Fields§
§method: GatewayMethodHTTP method
path: GatewayPathParsed path
accept: Option<String>Accept header for content negotiation
range: Option<String>Range header for partial content
host: Option<String>Host header (for subdomain gateway)
query: HashMap<String, String>Query parameters
Implementations§
Source§impl GatewayRequest
impl GatewayRequest
Sourcepub fn new(method: GatewayMethod, path: GatewayPath) -> Self
pub fn new(method: GatewayMethod, path: GatewayPath) -> Self
Create a new gateway request.
Sourcepub fn with_accept(self, accept: String) -> Self
pub fn with_accept(self, accept: String) -> Self
Set the accept header.
Sourcepub fn with_range(self, range: String) -> Self
pub fn with_range(self, range: String) -> Self
Set the range header.
Sourcepub fn content_type(&self) -> GatewayContentType
pub fn content_type(&self) -> GatewayContentType
Get the desired content type based on Accept header.
Sourcepub fn is_subdomain_request(&self) -> bool
pub fn is_subdomain_request(&self) -> bool
Check if this is a subdomain gateway request.
Trait Implementations§
Source§impl Clone for GatewayRequest
impl Clone for GatewayRequest
Source§fn clone(&self) -> GatewayRequest
fn clone(&self) -> GatewayRequest
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for GatewayRequest
impl RefUnwindSafe for GatewayRequest
impl Send for GatewayRequest
impl Sync for GatewayRequest
impl Unpin for GatewayRequest
impl UnwindSafe for GatewayRequest
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§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>
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 more