pub struct Request { /* private fields */ }Expand description
An incoming request to the DNS catalog
Implementations§
Source§impl Request
impl Request
Sourcepub fn from_bytes(
raw: Vec<u8>,
src: SocketAddr,
protocol: Protocol,
) -> Result<Self, ProtoError>
pub fn from_bytes( raw: Vec<u8>, src: SocketAddr, protocol: Protocol, ) -> Result<Self, ProtoError>
Construct a new Request from the raw bytes, source address, and protocol
Sourcepub fn from_message(
message: MessageRequest,
src: SocketAddr,
protocol: Protocol,
) -> Result<Self, ProtoError>
Available on crate feature testing only.
pub fn from_message( message: MessageRequest, src: SocketAddr, protocol: Protocol, ) -> Result<Self, ProtoError>
testing only.Construct a new Request from the encoding of a MessageRequest, source address, and protocol
Sourcepub fn request_info(&self) -> Result<RequestInfo<'_>, LookupError>
pub fn request_info(&self) -> Result<RequestInfo<'_>, LookupError>
Return just the header and request information from the Request Message
Returns an error if there is not exactly one query
Sourcepub fn src(&self) -> SocketAddr
pub fn src(&self) -> SocketAddr
The IP address from which the request originated.
Methods from Deref<Target = MessageRequest>§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
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> 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