openthread_sys

Struct 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 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

Source§

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>,

Source§

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>,

Source§

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.