Enum tor_netdoc::types::policy::PolicyError
source · #[non_exhaustive]pub enum PolicyError {
InvalidPort,
InvalidRange,
InvalidAddress,
MaskWithStar,
InvalidMask,
InvalidPolicy,
}
Expand description
Error from an unparsable or invalid policy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidPort
A port was not a number in the range 1..65535
InvalidRange
A port range had its starting-point higher than its ending point.
InvalidAddress
An address could not be interpreted.
MaskWithStar
Tried to use a bitmask with the address “*”.
InvalidMask
A bit mask was out of range.
InvalidPolicy
A policy could not be parsed for some other reason.
Trait Implementations§
source§impl Clone for PolicyError
impl Clone for PolicyError
source§fn clone(&self) -> PolicyError
fn clone(&self) -> PolicyError
Returns a copy of the value. Read more
1.0.0 · 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 PolicyError
impl Debug for PolicyError
source§impl Display for PolicyError
impl Display for PolicyError
source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<PolicyError> for Error
impl From<PolicyError> for Error
source§fn from(source: PolicyError) -> Error
fn from(source: PolicyError) -> Error
Converts to this type from the input type.
source§impl PartialEq for PolicyError
impl PartialEq for PolicyError
source§fn eq(&self, other: &PolicyError) -> bool
fn eq(&self, other: &PolicyError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for PolicyError
impl StructuralPartialEq for PolicyError
Auto Trait Implementations§
impl Freeze for PolicyError
impl RefUnwindSafe for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnwindSafe for PolicyError
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<E> ErrorReport for Ewhere
E: Error + 'static,
impl<E> ErrorReport for Ewhere
E: Error + 'static,
source§fn report(&self) -> Report<ReportHelper<'_>>
fn report(&self) -> Report<ReportHelper<'_>>
Return an object that displays the error and its causes
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more