use crate::rfc5389::attributes::ErrorCode;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Forbidden;
impl Forbidden {
pub const CODEPOINT: u16 = 403;
}
impl From<Forbidden> for ErrorCode {
fn from(_: Forbidden) -> Self {
ErrorCode::new(Forbidden::CODEPOINT, "Forbidden".to_owned()).expect("never fails")
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct AllocationMismatch;
impl AllocationMismatch {
pub const CODEPOINT: u16 = 437;
}
impl From<AllocationMismatch> for ErrorCode {
fn from(_: AllocationMismatch) -> Self {
ErrorCode::new(
AllocationMismatch::CODEPOINT,
"Allocation Mismatch".to_owned(),
)
.expect("never fails")
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct WrongCredentials;
impl WrongCredentials {
pub const CODEPOINT: u16 = 441;
}
impl From<WrongCredentials> for ErrorCode {
fn from(_: WrongCredentials) -> Self {
ErrorCode::new(WrongCredentials::CODEPOINT, "Wrong Credentials".to_owned())
.expect("never fails")
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct UnsupportedTransportProtocol;
impl UnsupportedTransportProtocol {
pub const CODEPOINT: u16 = 442;
}
impl From<UnsupportedTransportProtocol> for ErrorCode {
fn from(_: UnsupportedTransportProtocol) -> Self {
ErrorCode::new(
UnsupportedTransportProtocol::CODEPOINT,
"Unsupported Transport Protocol".to_owned(),
)
.expect("never fails")
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct AllocationQuotaReached;
impl AllocationQuotaReached {
pub const CODEPOINT: u16 = 486;
}
impl From<AllocationQuotaReached> for ErrorCode {
fn from(_: AllocationQuotaReached) -> Self {
ErrorCode::new(
AllocationQuotaReached::CODEPOINT,
"Allocation Quota Reached".to_owned(),
)
.expect("never fails")
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct InsufficientCapacity;
impl InsufficientCapacity {
pub const CODEPOINT: u16 = 508;
}
impl From<InsufficientCapacity> for ErrorCode {
fn from(_: InsufficientCapacity) -> Self {
ErrorCode::new(
InsufficientCapacity::CODEPOINT,
"Insufficient Capacity".to_owned(),
)
.expect("never fails")
}
}