pub struct TcpKeepalive(/* private fields */);
Expand description
Option data for the edns-tcp-keepalive option.
The edns-tcp-keepalive option can be used to determine a time a server would like a client to keep a TCP connection open after receiving an answer. The client includes the option without a value in its query to indicate support for the option. The server then includes the option in its response, including a 16-bit value that provides the idle time in units of 100 milliseconds.
Implementations§
source§impl TcpKeepalive
impl TcpKeepalive
sourcepub fn new(timeout: Option<IdleTimeout>) -> Self
pub fn new(timeout: Option<IdleTimeout>) -> Self
Creates a new value from an optional idle timeout.
sourcepub fn timeout(self) -> Option<IdleTimeout>
pub fn timeout(self) -> Option<IdleTimeout>
Returns the idle timeout.
Trait Implementations§
source§impl Clone for TcpKeepalive
impl Clone for TcpKeepalive
source§fn clone(&self) -> TcpKeepalive
fn clone(&self) -> TcpKeepalive
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ComposeOptData for TcpKeepalive
impl ComposeOptData for TcpKeepalive
fn compose_len(&self) -> u16
fn compose_option<Target: OctetsBuilder + ?Sized>( &self, target: &mut Target, ) -> Result<(), Target::AppendError>
source§impl Debug for TcpKeepalive
impl Debug for TcpKeepalive
source§impl Display for TcpKeepalive
impl Display for TcpKeepalive
source§impl<Octs, Name> From<TcpKeepalive> for AllOptData<Octs, Name>
impl<Octs, Name> From<TcpKeepalive> for AllOptData<Octs, Name>
source§fn from(value: TcpKeepalive) -> Self
fn from(value: TcpKeepalive) -> Self
Converts to this type from the input type.
source§impl Hash for TcpKeepalive
impl Hash for TcpKeepalive
source§impl OptData for TcpKeepalive
impl OptData for TcpKeepalive
source§fn code(&self) -> OptionCode
fn code(&self) -> OptionCode
Returns the option code associated with this option.
source§impl Ord for TcpKeepalive
impl Ord for TcpKeepalive
source§fn cmp(&self, other: &TcpKeepalive) -> Ordering
fn cmp(&self, other: &TcpKeepalive) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'a, Octs: AsRef<[u8]>> ParseOptData<'a, Octs> for TcpKeepalive
impl<'a, Octs: AsRef<[u8]>> ParseOptData<'a, Octs> for TcpKeepalive
source§fn parse_option(
code: OptionCode,
parser: &mut Parser<'a, Octs>,
) -> Result<Option<Self>, ParseError>
fn parse_option( code: OptionCode, parser: &mut Parser<'a, Octs>, ) -> Result<Option<Self>, ParseError>
Parses the option code data. Read more
source§impl PartialEq for TcpKeepalive
impl PartialEq for TcpKeepalive
source§impl PartialOrd for TcpKeepalive
impl PartialOrd for TcpKeepalive
impl Copy for TcpKeepalive
impl Eq for TcpKeepalive
impl StructuralPartialEq for TcpKeepalive
Auto Trait Implementations§
impl Freeze for TcpKeepalive
impl RefUnwindSafe for TcpKeepalive
impl Send for TcpKeepalive
impl Sync for TcpKeepalive
impl Unpin for TcpKeepalive
impl UnwindSafe for TcpKeepalive
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.
source§fn octets_into(self) -> Target
fn octets_into(self) -> Target
Performs an infallible conversion.