[−][src]Struct domain::rdata::rfc2845::Tsig
Methods
impl<O, N> Tsig<O, N>
[src]
pub fn new(
algorithm: N,
time_signed: Time48,
fudge: u16,
mac: O,
original_id: u16,
error: TsigRcode,
other: O
) -> Self
[src]
algorithm: N,
time_signed: Time48,
fudge: u16,
mac: O,
original_id: u16,
error: TsigRcode,
other: O
) -> Self
Creates a new TSIG record from its components.
See the access methods for an explanation of these components.
Panics
Since time_signed
is actually a 48 bit integer, the function will
panic of the upper 16 bits are not all 0.
pub fn algorithm(&self) -> &N
[src]
Returns a reference to the algorithm name.
TSIG encodes the algorithm used for keys and signatures as a domain name. It does, however, only use the format. No structure is used at all.
pub fn time_signed(&self) -> Time48
[src]
Returns the Unix time when the signature is created.
Despite its type, this is actually a 48 bit number. The upper 16 bits will never be set.
pub fn fudge(&self) -> u16
[src]
Return the number of seconds of offset from signing time permitted.
When a signature is checked, the local system time needs to be within
this many seconds from time_signed
to be accepted.
pub fn mac(&self) -> &O
[src]
Returns a reference to the bytes value containing the MAC.
pub fn mac_slice(&self) -> &[u8] where
O: AsRef<[u8]>,
[src]
O: AsRef<[u8]>,
Returns an octet slice containing the MAC.
pub fn into_mac(self) -> O
[src]
Converts the record data into the MAC.
pub fn original_id(&self) -> u16
[src]
Returns the original message ID.
Since the message ID is part of the signature generation but may be changed for a forwarded message, it is included in the TSIG record.
pub fn error(&self) -> TsigRcode
[src]
Returns the TSIG error.
pub fn other(&self) -> &O
[src]
Returns a reference to the other bytes.
This field is only used for BADTIME errors to return the server time. Otherwise it is empty.
pub fn other_time(&self) -> Option<Time48> where
O: AsRef<[u8]>,
[src]
O: AsRef<[u8]>,
Returns the other bytes as the server time.
If the other bytes field is exactly 6 bytes long, this methods
returns it as a u64
representation of the Unix time contained.
pub fn is_valid_now(&self) -> bool
[src]
Returns whether the record is valid right now.
The method checks whether the current system time is within fudge
seconds of the time_signed
.
Trait Implementations
impl<O, OO, N, NN> CanonicalOrd<Tsig<OO, NN>> for Tsig<O, N> where
O: AsRef<[u8]>,
OO: AsRef<[u8]>,
N: ToDname,
NN: ToDname,
[src]
O: AsRef<[u8]>,
OO: AsRef<[u8]>,
N: ToDname,
NN: ToDname,
fn canonical_cmp(&self, other: &Tsig<OO, NN>) -> Ordering
[src]
#[must_use]fn canonical_lt(&self, other: &Rhs) -> bool
[src]
#[must_use]fn canonical_le(&self, other: &Rhs) -> bool
[src]
#[must_use]fn canonical_gt(&self, other: &Rhs) -> bool
[src]
#[must_use]fn canonical_ge(&self, other: &Rhs) -> bool
[src]
impl<O: Clone, N: Clone> Clone for Tsig<O, N>
[src]
impl<O: AsRef<[u8]>, N: Compose> Compose for Tsig<O, N>
[src]
fn compose<T: OctetsBuilder>(&self, target: &mut T) -> Result<(), ShortBuf>
[src]
fn compose_canonical<T: OctetsBuilder>(
&self,
target: &mut T
) -> Result<(), ShortBuf>
[src]
&self,
target: &mut T
) -> Result<(), ShortBuf>
impl<O: AsRef<[u8]>, N: Debug> Debug for Tsig<O, N>
[src]
impl<O: AsRef<[u8]>, N: Display> Display for Tsig<O, N>
[src]
impl<O: AsRef<[u8]>, N: ToDname> Eq for Tsig<O, N>
[src]
impl<O, N> From<Tsig<O, N>> for AllRecordData<O, N>
[src]
impl<O: AsRef<[u8]>, N: Hash> Hash for Tsig<O, N>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<O: AsRef<[u8]>, N: ToDname> Ord for Tsig<O, N>
[src]
fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<Ref: OctetsRef> Parse<Ref> for Tsig<Ref::Range, ParsedDname<Ref>>
[src]
fn parse(parser: &mut Parser<Ref>) -> Result<Self, ParseError>
[src]
fn skip(parser: &mut Parser<Ref>) -> Result<(), ParseError>
[src]
impl<O, OO, N, NN> PartialEq<Tsig<OO, NN>> for Tsig<O, N> where
O: AsRef<[u8]>,
OO: AsRef<[u8]>,
N: ToDname,
NN: ToDname,
[src]
O: AsRef<[u8]>,
OO: AsRef<[u8]>,
N: ToDname,
NN: ToDname,
fn eq(&self, other: &Tsig<OO, NN>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<O, OO, N, NN> PartialOrd<Tsig<OO, NN>> for Tsig<O, N> where
O: AsRef<[u8]>,
OO: AsRef<[u8]>,
N: ToDname,
NN: ToDname,
[src]
O: AsRef<[u8]>,
OO: AsRef<[u8]>,
N: ToDname,
NN: ToDname,
fn partial_cmp(&self, other: &Tsig<OO, NN>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<O, N> RtypeRecordData for Tsig<O, N>
[src]
Auto Trait Implementations
impl<O, N> RefUnwindSafe for Tsig<O, N> where
N: RefUnwindSafe,
O: RefUnwindSafe,
N: RefUnwindSafe,
O: RefUnwindSafe,
impl<O, N> Send for Tsig<O, N> where
N: Send,
O: Send,
N: Send,
O: Send,
impl<O, N> Sync for Tsig<O, N> where
N: Sync,
O: Sync,
N: Sync,
O: Sync,
impl<O, N> Unpin for Tsig<O, N> where
N: Unpin,
O: Unpin,
N: Unpin,
O: Unpin,
impl<O, N> UnwindSafe for Tsig<O, N> where
N: UnwindSafe,
O: UnwindSafe,
N: UnwindSafe,
O: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Octets, T> ParseRecordData<Octets> for T where
T: RtypeRecordData + Parse<Octets> + Compose,
[src]
T: RtypeRecordData + Parse<Octets> + Compose,
fn parse_data(Rtype, &mut Parser<Octets>) -> Result<Option<T>, ParseError>
[src]
impl<T> RecordData for T where
T: Compose + RtypeRecordData,
[src]
T: Compose + RtypeRecordData,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,