pub enum ProtocolError {
RequestTooShort {
received: usize,
},
UnexpectedMode {
mode: u8,
},
UnsupportedVersion {
version: u8,
},
ZeroTransmitTimestamp,
NoExtensionFields,
Other(String),
}Expand description
NTP protocol validation errors for incoming client requests.
These correspond to the checks performed in
server_common::validation per RFC 5905 Section 8.
Variants§
RequestTooShort
Request packet too short (< 48 bytes).
UnexpectedMode
Request has unexpected mode (expected Client or SymmetricActive).
UnsupportedVersion
Unsupported NTP version in request.
ZeroTransmitTimestamp
Client transmit timestamp is zero.
NoExtensionFields
Request has no extension fields (expected for NTS).
Other(String)
Generic protocol error.
Trait Implementations§
Source§impl Clone for ProtocolError
impl Clone for ProtocolError
Source§fn clone(&self) -> ProtocolError
fn clone(&self) -> ProtocolError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProtocolError
impl Debug for ProtocolError
Source§impl Display for ProtocolError
impl Display for ProtocolError
Source§impl Error for ProtocolError
impl Error for ProtocolError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ProtocolError> for NtpServerError
impl From<ProtocolError> for NtpServerError
Source§fn from(err: ProtocolError) -> NtpServerError
fn from(err: ProtocolError) -> NtpServerError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProtocolError
impl RefUnwindSafe for ProtocolError
impl Send for ProtocolError
impl Sync for ProtocolError
impl Unpin for ProtocolError
impl UnsafeUnpin for ProtocolError
impl UnwindSafe for ProtocolError
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