mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-17 01:43:44 +02:00
65 lines
1.6 KiB
Rust
65 lines
1.6 KiB
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
*
|
|
* (c)2021 ZeroTier, Inc.
|
|
* https://www.zerotier.com/
|
|
*/
|
|
|
|
use std::error::Error;
|
|
use std::fmt::{Display, Debug};
|
|
|
|
pub struct InvalidFormatError;
|
|
|
|
impl Display for InvalidFormatError {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
f.write_str("InvalidFormatError")
|
|
}
|
|
}
|
|
|
|
impl Debug for InvalidFormatError {
|
|
#[inline(always)]
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
<Self as Display>::fmt(self, f)
|
|
}
|
|
}
|
|
|
|
impl Error for InvalidFormatError {}
|
|
|
|
/****/
|
|
|
|
pub struct InvalidParameterError(pub(crate) &'static str);
|
|
|
|
impl Display for InvalidParameterError {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f, "InvalidParameterError: {}", self.0)
|
|
}
|
|
}
|
|
|
|
impl Debug for InvalidParameterError {
|
|
#[inline(always)]
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
<Self as Display>::fmt(self, f)
|
|
}
|
|
}
|
|
|
|
impl Error for InvalidParameterError {}
|
|
|
|
/****/
|
|
|
|
pub struct MalformedRecordError(pub(crate) &'static str);
|
|
|
|
impl Display for MalformedRecordError {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
write!(f, "InvalidParameterError: {}", self.0)
|
|
}
|
|
}
|
|
|
|
impl Debug for MalformedRecordError {
|
|
#[inline(always)]
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
<Self as Display>::fmt(self, f)
|
|
}
|
|
}
|
|
|
|
impl Error for MalformedRecordError {}
|