pub struct QuerySpec { /* private fields */ }Expand description
Spec for starting a query.
Implementations§
Source§impl QuerySpec
impl QuerySpec
Sourcepub fn new(qname: Name, qtype: ResourceType) -> QuerySpec
Available on crate features alloc or no-atomic or std only.
pub fn new(qname: Name, qtype: ResourceType) -> QuerySpec
alloc or no-atomic or std only.Build a new spec for an mDNS query.
Sourcepub fn qname(&self) -> &Name
Available on crate features alloc or no-atomic or std only.
pub fn qname(&self) -> &Name
alloc or no-atomic or std only.The query name.
Sourcepub const fn qtype(&self) -> ResourceType
Available on crate features alloc or no-atomic or std only.
pub const fn qtype(&self) -> ResourceType
alloc or no-atomic or std only.The query resource type.
Sourcepub const fn qclass(&self) -> ResourceClass
Available on crate features alloc or no-atomic or std only.
pub const fn qclass(&self) -> ResourceClass
alloc or no-atomic or std only.The query class.
Sourcepub const fn unicast_response(&self) -> bool
Available on crate features alloc or no-atomic or std only.
pub const fn unicast_response(&self) -> bool
alloc or no-atomic or std only.Whether to request unicast responses (RFC 6762 §5.4).
Sourcepub const fn timeout(&self) -> Option<Duration>
Available on crate features alloc or no-atomic or std only.
pub const fn timeout(&self) -> Option<Duration>
alloc or no-atomic or std only.The absolute timeout for the query, if set.
Sourcepub const fn max_answers(&self) -> Option<usize>
Available on crate features alloc or no-atomic or std only.
pub const fn max_answers(&self) -> Option<usize>
alloc or no-atomic or std only.Maximum number of collected answers, if explicitly overridden.
When None the Query state machine uses its built-in default (256).
Sourcepub const fn with_qclass(self, v: ResourceClass) -> QuerySpec
Available on crate features alloc or no-atomic or std only.
pub const fn with_qclass(self, v: ResourceClass) -> QuerySpec
alloc or no-atomic or std only.Override the query class.
Sourcepub const fn with_unicast_response(self, v: bool) -> QuerySpec
Available on crate features alloc or no-atomic or std only.
pub const fn with_unicast_response(self, v: bool) -> QuerySpec
alloc or no-atomic or std only.Request unicast responses (RFC 6762 §5.4).
Sourcepub const fn with_timeout(self, v: Duration) -> QuerySpec
Available on crate features alloc or no-atomic or std only.
pub const fn with_timeout(self, v: Duration) -> QuerySpec
alloc or no-atomic or std only.Set an absolute timeout for the query.
Sourcepub const fn with_max_answers(self, max: usize) -> QuerySpec
Available on crate features alloc or no-atomic or std only.
pub const fn with_max_answers(self, max: usize) -> QuerySpec
alloc or no-atomic or std only.Override the maximum number of collected answers for this query.
When the pool reaches max, the oldest entry (FIFO) is evicted to make
room. Setting max to 0 disables answer collection entirely.
Trait Implementations§
impl Eq for QuerySpec
impl StructuralPartialEq for QuerySpec
Auto Trait Implementations§
impl Freeze for QuerySpec
impl RefUnwindSafe for QuerySpec
impl Send for QuerySpec
impl Sync for QuerySpec
impl Unpin for QuerySpec
impl UnsafeUnpin for QuerySpec
impl UnwindSafe for QuerySpec
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§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