pub enum SynchronizationError {
IOError(Error),
ProtocolError(ProtocolError),
}
Expand description
Synchronization error
Returned when synchronization fails.
Variants§
IOError(Error)
An I/O error occured during the query, like socket error, timeout, etc…
ProtocolError(ProtocolError)
SNTP protocol specific error
Implementations§
Source§impl SynchronizationError
impl SynchronizationError
Sourcepub fn is_kiss_of_death(&self) -> bool
pub fn is_kiss_of_death(&self) -> bool
Check if the error is a Kiss-o’-Death. KoD is a special error case as it indicates that client should stop sending request to the server. This helper function checks directly for that error condition.
use rsntp::SntpClient;
let client = SntpClient::new();
let result = client.synchronize("pool.ntp.org");
if let Err(err) = result {
if err.is_kiss_of_death() {
println!("Kiss-o'-Death")
}
}
Trait Implementations§
Source§impl Debug for SynchronizationError
impl Debug for SynchronizationError
Source§impl Display for SynchronizationError
impl Display for SynchronizationError
Source§impl Error for SynchronizationError
impl Error for SynchronizationError
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<Error> for SynchronizationError
impl From<Error> for SynchronizationError
Source§fn from(io_error: Error) -> SynchronizationError
fn from(io_error: Error) -> SynchronizationError
Converts to this type from the input type.
Source§impl From<ProtocolError> for SynchronizationError
impl From<ProtocolError> for SynchronizationError
Source§fn from(protocol_error: ProtocolError) -> SynchronizationError
fn from(protocol_error: ProtocolError) -> SynchronizationError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SynchronizationError
impl !RefUnwindSafe for SynchronizationError
impl Send for SynchronizationError
impl Sync for SynchronizationError
impl Unpin for SynchronizationError
impl !UnwindSafe for SynchronizationError
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