Struct openthread_sys::otDnsTxtEntry
source · #[repr(C)]pub struct otDnsTxtEntry {
pub mKey: *const c_char,
pub mValue: *const u8,
pub mValueLength: u16,
}
Expand description
Represents a TXT record entry representing a key/value pair (RFC 6763 - section 6.3).
The string buffers pointed to by mKey
and mValue
MUST persist and remain unchanged after an instance of such
structure is passed to OpenThread (as part of otSrpClientService
instance).
An array of otDnsTxtEntry
entries are used in otSrpClientService
to specify the full TXT record (a list of
entries).
Fields§
§mKey: *const c_char
The TXT record key string.
If mKey
is not NULL, then it MUST be a null-terminated C string. The entry is treated as key/value pair with
mValue
buffer providing the value.
- The entry is encoded as follows:
- A single string length byte followed by “key=value” format (without the quotation marks).
- In this case, the overall encoded length must be 255 bytes or less.
- If
mValue
is NULL, then key is treated as a boolean attribute and encoded as “key” (with no=
). - If
mValue
is not NULL butmValueLength
is zero, then it is treated as empty value and encoded as “key=”.
- If
If mKey
is NULL, then mValue
buffer is treated as an already encoded TXT-DATA and is appended as is in the
DNS message.
mValue: *const u8
< The TXT record value or already encoded TXT-DATA (depending on mKey
).
mValueLength: u16
< Number of bytes in mValue
buffer.
Trait Implementations§
source§impl Clone for otDnsTxtEntry
impl Clone for otDnsTxtEntry
source§fn clone(&self) -> otDnsTxtEntry
fn clone(&self) -> otDnsTxtEntry
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for otDnsTxtEntry
impl Debug for otDnsTxtEntry
source§impl Default for otDnsTxtEntry
impl Default for otDnsTxtEntry
impl Copy for otDnsTxtEntry
Auto Trait Implementations§
impl Freeze for otDnsTxtEntry
impl RefUnwindSafe for otDnsTxtEntry
impl !Send for otDnsTxtEntry
impl !Sync for otDnsTxtEntry
impl Unpin for otDnsTxtEntry
impl UnwindSafe for otDnsTxtEntry
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)