pub enum MicrodescriptorError {
Io(Error),
InvalidOnionKey(String),
InvalidNtorOnionKey(String),
InvalidSocketAddress(AddrParseError),
InvalidRelayFamily(String),
InvalidPortPolicy(String),
InvalidBase64(String),
InvalidIdentityLength {
algorithm: String,
expected: usize,
actual: usize,
},
UnknownIdentityAlgorithm(String),
IncompleteCryptoBlock(String),
MissingRequiredField(String),
}Expand description
Errors that can occur when parsing microdescriptors.
Microdescriptors are compact descriptors used by clients for building circuits with minimal bandwidth overhead.
§Example
use stem_rs::descriptor::MicrodescriptorError;
fn handle_micro_error(err: MicrodescriptorError) {
match err {
MicrodescriptorError::InvalidOnionKey(msg) => {
eprintln!("Invalid onion key: {}", msg);
}
MicrodescriptorError::MissingRequiredField(field) => {
eprintln!("Missing required field: {}", field);
}
_ => eprintln!("Microdescriptor parse error: {}", err),
}
}Variants§
Io(Error)
IO error occurred while reading descriptor data.
InvalidOnionKey(String)
Onion key format is invalid.
InvalidNtorOnionKey(String)
Ntor onion key format is invalid.
InvalidSocketAddress(AddrParseError)
Socket address format is invalid.
InvalidRelayFamily(String)
Relay family specification is invalid.
InvalidPortPolicy(String)
Port policy format is invalid.
InvalidBase64(String)
Base64 encoding is invalid.
InvalidIdentityLength
Identity key has wrong length for algorithm.
Fields
UnknownIdentityAlgorithm(String)
Identity algorithm is not recognized.
IncompleteCryptoBlock(String)
Cryptographic block is incomplete.
MissingRequiredField(String)
Required field is missing from descriptor.
Trait Implementations§
Source§impl Debug for MicrodescriptorError
impl Debug for MicrodescriptorError
Source§impl Display for MicrodescriptorError
impl Display for MicrodescriptorError
Source§impl Error for MicrodescriptorError
impl Error for MicrodescriptorError
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<AddrParseError> for MicrodescriptorError
impl From<AddrParseError> for MicrodescriptorError
Source§fn from(source: AddrParseError) -> Self
fn from(source: AddrParseError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for MicrodescriptorError
impl From<Error> for MicrodescriptorError
Source§impl From<MicrodescriptorError> for DescriptorError
impl From<MicrodescriptorError> for DescriptorError
Source§fn from(source: MicrodescriptorError) -> Self
fn from(source: MicrodescriptorError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MicrodescriptorError
impl !RefUnwindSafe for MicrodescriptorError
impl Send for MicrodescriptorError
impl Sync for MicrodescriptorError
impl Unpin for MicrodescriptorError
impl !UnwindSafe for MicrodescriptorError
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