pub struct QuerySpec { /* private fields */ }Available on crate features
alloc or heapless or no-atomic or std only.Expand description
Spec for starting a query.
Implementations§
Source§impl QuerySpec
impl QuerySpec
Sourcepub fn new(qname: Name, qtype: ResourceType) -> Self
pub fn new(qname: Name, qtype: ResourceType) -> Self
Build a new spec for an mDNS query.
Sourcepub const fn qtype(&self) -> ResourceType
pub const fn qtype(&self) -> ResourceType
The query resource type.
Sourcepub const fn qclass(&self) -> ResourceClass
pub const fn qclass(&self) -> ResourceClass
The query class.
Sourcepub const fn unicast_response(&self) -> bool
pub const fn unicast_response(&self) -> bool
Whether to request unicast responses (RFC 6762 §5.4).
Sourcepub const fn max_answers(&self) -> Option<usize>
pub const fn max_answers(&self) -> Option<usize>
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) -> Self
pub const fn with_qclass(self, v: ResourceClass) -> Self
Override the query class.
Sourcepub const fn with_unicast_response(self, v: bool) -> Self
pub const fn with_unicast_response(self, v: bool) -> Self
Request unicast responses (RFC 6762 §5.4).
Sourcepub const fn with_timeout(self, v: Duration) -> Self
pub const fn with_timeout(self, v: Duration) -> Self
Set an absolute timeout for the query.
Sourcepub const fn with_max_answers(self, max: usize) -> Self
pub const fn with_max_answers(self, max: usize) -> Self
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