Struct Txt
pub struct Txt { /* private fields */ }dns and std only.Expand description
One validated TXT-record RDATA value.
A TXT record contains one or more binary DNS character-strings. Record and string boundaries are preserved in one shared, canonical wire buffer.
Implementations§
§impl Txt
impl Txt
pub fn parse_rdata(rdata: &[u8]) -> Result<Txt, TxtParseError>
pub fn parse_rdata(rdata: &[u8]) -> Result<Txt, TxtParseError>
Parse one complete borrowed TXT RDATA value.
Validation occurs before one exact-sized copy. Use
Self::parse_rdata_bytes when the caller already owns a
proportionately sized Bytes value.
pub fn parse_rdata_bytes(rdata: &Bytes) -> Result<Txt, TxtParseError>
pub fn parse_rdata_bytes(rdata: &Bytes) -> Result<Txt, TxtParseError>
Parse one complete owned TXT RDATA value without copying its strings.
Retaining a slice also retains its parent allocation. Callers should
use this only when that allocation is already proportionate to this
record, and use Self::parse_rdata for slices of oversized packets or
callback storage.
pub fn try_from_strings<I, S>(strings: I) -> Result<Txt, TxtParseError>
pub fn try_from_strings<I, S>(strings: I) -> Result<Txt, TxtParseError>
Construct one TXT record from decoded binary character-strings.
At least one string is required. Every string may contain arbitrary octets but must be at most 255 octets long, and their complete encoded RDATA must fit the DNS 16-bit RDLENGTH field.
pub fn iter(&self) -> impl ExactSizeIterator + FusedIterator + Clone
pub fn iter(&self) -> impl ExactSizeIterator + FusedIterator + Clone
Iterate over borrowed binary character-strings.
pub fn into_strings(self) -> impl ExactSizeIterator + FusedIterator + Clone
pub fn into_strings(self) -> impl ExactSizeIterator + FusedIterator + Clone
Consume this record and iterate over zero-copy owned string slices.
Every yielded slice shares the complete record allocation. Prefer
Self::iter and copy an individual string when it must outlive a much
larger record without retaining that record.
Trait Implementations§
§impl DnsTxtResolver for Txt
impl DnsTxtResolver for Txt
§type Error = !
type Error = !
DnsTxtResolver§fn lookup_txt(
&self,
_: Domain,
) -> impl Stream<Item = Result<Txt, <Txt as DnsTxtResolver>::Error>> + Send
fn lookup_txt( &self, _: Domain, ) -> impl Stream<Item = Result<Txt, <Txt as DnsTxtResolver>::Error>> + Send
§fn into_box_dns_txt_resolver(self) -> BoxDnsTxtResolver
fn into_box_dns_txt_resolver(self) -> BoxDnsTxtResolver
impl Eq for Txt
impl StructuralPartialEq for Txt
Auto Trait Implementations§
impl !Freeze for Txt
impl RefUnwindSafe for Txt
impl Send for Txt
impl Sync for Txt
impl Unpin for Txt
impl UnsafeUnpin for Txt
impl UnwindSafe for Txt
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.