Skip to main content

CharStrBuf

Struct CharStrBuf 

Source
pub struct CharStrBuf { /* private fields */ }
Available on crate feature unstable-new only.
Expand description

A 256-byte buffer for a character string.

Implementations§

Source§

impl CharStrBuf

Source

pub fn copy_from(string: &CharStr) -> Self

Copy a CharStrBuf into a buffer.

Source§

impl CharStrBuf

Source

pub fn wire_bytes(&self) -> &[u8]

The wire format for this character string.

Methods from Deref<Target = CharStr>§

Source

pub fn len(&self) -> usize

The length of the CharStr.

This is always less than 256 – it is guaranteed to fit in a u8.

Source

pub fn is_empty(&self) -> bool

Whether the CharStr is empty.

Trait Implementations§

Source§

impl AsMut<CharStr> for CharStrBuf

Source§

fn as_mut(&mut self) -> &mut CharStr

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<CharStr> for CharStrBuf

Source§

fn as_ref(&self) -> &CharStr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<CharStr> for CharStrBuf

Source§

fn borrow(&self) -> &CharStr

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut<CharStr> for CharStrBuf

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl BuildBytes for CharStrBuf

Source§

fn build_bytes<'b>( &self, bytes: &'b mut [u8], ) -> Result<&'b mut [u8], TruncationError>

Serialize into a byte sequence. Read more
Source§

fn built_bytes_size(&self) -> usize

The size of self when serialized into a byte sequence. Read more
Source§

impl BuildInMessage for CharStrBuf

Source§

fn build_in_message( &self, contents: &mut [u8], start: usize, name: &mut NameCompressor, ) -> Result<usize, TruncationError>

Write this object in a DNS message. Read more
Source§

impl Clone for CharStrBuf

Source§

fn clone(&self) -> CharStrBuf

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for CharStrBuf

Source§

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

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

impl Deref for CharStrBuf

Source§

type Target = CharStr

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for CharStrBuf

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl Eq for CharStrBuf

Source§

impl FromStr for CharStrBuf

Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parse a DNS “character-string” from a string.

This is intended for easily constructing hard-coded character strings. This function cannot parse all valid character strings; if exceptional instances are needed, use CharStr::from_bytes_unchecked().

Source§

type Err = CharStrParseError

The associated error which can be returned from parsing.
Source§

impl ParseBytes<'_> for CharStrBuf

Source§

fn parse_bytes(bytes: &[u8]) -> Result<Self, ParseError>

Parse a value of Self from the given byte sequence. Read more
Source§

impl ParseMessageBytes<'_> for CharStrBuf

Source§

fn parse_message_bytes( contents: &[u8], start: usize, ) -> Result<Self, ParseError>

Parse a value from bytes in a DNS message. Read more
Source§

impl PartialEq for CharStrBuf

Source§

fn eq(&self, that: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl SplitBytes<'_> for CharStrBuf

Source§

fn split_bytes(bytes: &[u8]) -> Result<(Self, &[u8]), ParseError>

Parse a value of Self from the start of the byte sequence. Read more
Source§

impl SplitMessageBytes<'_> for CharStrBuf

Source§

fn split_message_bytes( contents: &[u8], start: usize, ) -> Result<(Self, usize), ParseError>

Parse a value from the start of a byte sequence within a DNS message. Read more
Source§

impl UnsizedCopyFrom for CharStrBuf

Source§

type Source = CharStr

The source type to copy from.
Source§

fn unsized_copy_from(value: &Self::Source) -> Self

Create a new Self by copying the given value.

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

Source§

type Error = <Target as OctetsFrom<Source>>::Error

Source§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
Source§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more