#[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 but mValueLength is zero, then it is treated as empty value and encoded as “key=”.

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

source§

fn clone(&self) -> otDnsTxtEntry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for otDnsTxtEntry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for otDnsTxtEntry

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for otDnsTxtEntry

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.