Skip to main content

Module misc

Module misc 

Source
Expand description

Types used to parse arguments of entries in a directory document.

There are some types that are pretty common, like “ISOTime”, “base64-encoded data”, and so on.

Re-exports§

pub use nickname::InvalidNickname;
pub use nickname::Nickname;
pub use boolean::NumericBoolean;
pub use fingerprint::Base64Fingerprint;
pub use fingerprint::Fingerprint;
pub use identified_digest::DigestName;
pub use identified_digest::IdentifiedDigest;
pub use ignored_impl::Ignored;
pub use ignored_impl::IgnoredItemOrObjectValue;
pub use ignored_impl::ItemPresent;
pub use ignored_impl::NoMoreArguments;
pub use ignored_impl::NotPresent;
pub use ignored_impl::NotPresentEachValue;
use crate::NormalItemArgument; 🔒
use crate::encode; 🔒
use crate::encode::ItemArgument; 🔒
use crate::encode::ItemEncoder; 🔒
use crate::encode::ItemObjectEncodable; 🔒
use crate::encode::ItemValueEncodable; 🔒
use crate::encode::NetdocEncoder; 🔒
use crate::parse2; 🔒
use crate::parse2::ArgumentError; 🔒
use crate::parse2::ArgumentStream; 🔒
use crate::parse2::ItemArgumentParseable; 🔒
use crate::parse2::ItemObjectParseable; 🔒
use crate::parse2::ItemValueParseable; 🔒
use crate::parse2::SignatureHashInputs; 🔒
use crate::parse2::UnparsedItem; 🔒
use crate::parse2::multiplicity::ArgumentSetMethods; 🔒
use crate::parse2::multiplicity::ItemSetMethods; 🔒
use crate::parse2::multiplicity::MultiplicitySelector as P2MultiplicitySelector; 🔒
use crate::parse2::multiplicity::ObjectSetMethods; 🔒
use crate::parse2::sig_hashes::Sha1WholeKeywordLine; 🔒
use derive_deftly::Deftly; 🔒
use derive_deftly::define_derive_deftly; 🔒
use derive_deftly::define_derive_deftly_module; 🔒
use digest::Digest as _; 🔒
use educe::Educe; 🔒
use std::cmp; 🔒
use std::cmp::Ordering; 🔒
use std::cmp::PartialOrd; 🔒
use std::cmp::PartialOrd; 🔒
use std::fmt; 🔒
use std::fmt::Display; 🔒
use std::iter; 🔒
use std::marker::PhantomData; 🔒
use std::ops::Deref; 🔒
use std::ops::DerefMut; 🔒
use std::result::Result as StdResult; 🔒
use std::str::FromStr; 🔒
use subtle::Choice; 🔒
use subtle::ConstantTimeEq; 🔒
use tor_error::Bug; 🔒
use tor_error::ErrorReport as _; 🔒
use tor_error::internal; 🔒
use tor_error::into_internal; 🔒
use void::ResultVoidExt as _; 🔒
use void::Void; 🔒

Modules§

b16impl 🔒
Types for decoding hex-encoded values.
b64impl 🔒
Types for decoding base64-encoded values.
boolean 🔒
Types for boolean-like types.
contact_info 🔒
Contact information of the relay operator.
curve25519impl 🔒
Types for decoding curve25519 keys
ed25519impl 🔒
Types for decoding ed25519 keys
edcert 🔒
Types for decoding Ed25519 certificates
fingerprint 🔒
Types for decoding RSA fingerprints
hostname 🔒
Hostnames etc.
identified_digest 🔒
Digest identifiers, and digests in the form ALGORITHM=BASE64U
ignored_impl 🔒
Dummy types like Ignored
nickname 🔒
A type for relay nicknames
rsa 🔒
Types for decoding RSA keys
timeimpl 🔒
Types for decoding times and dates

Macros§

derive_deftly_module_Transparent 🔒
Implement conversion traits for a transparent newtype around bytes - shared code
derive_deftly_template_BytesTransparent 🔒
Implement ConstantTimeEq, .as_bytes(), etc., for a transparent newtype around bytes
derive_deftly_template_FixedBytes 🔒
Implement useful methods for a fixed-size byte array wrapper
derive_deftly_template_Transparent 🔒
Implement conversion traits for an arbitrary transparent newtype

Structs§

B16
A byte array encoded in hexadecimal; prints in lowercase
B64
A byte array, encoded in base64 with optional padding.
B16U
A byte array encoded in hexadecimal; prints in uppercase
Base64Fingerprint
A base64-encoded fingerprint (unpadded)
ContactInfo
contact item: contact information (eg of a relay dirauth operator)
Curve25519Public
A Curve25519 public key, encoded in base64 with optional padding
Ed25519FamilyCert
An Ed25519 family certificate.
Ed25519IdentityCert
An Ed25519 identity certificate.
Ed25519IdentityLine
Ed25519 public key in the form <keyword> id <base64>
Ed25519NtorCrossCert
Verified reverse cert by K_ntor on KP_relayid_ed
Ed25519Public
An alleged ed25519 public key, encoded in base64 with optional padding.
F64Finite
A finite floating point number
F64FiniteError
Error converting an F64Finite from an f64: the value wasn’t finite
Fingerprint
A hex-encoded fingerprint with no spaces.
FixedB64
A byte array encoded in base64 with a fixed length.
FixedB16U
A fixed-length version of B16U.
Hostname
Internet hostname
InvalidContactInfo
Contact information (contact item value) has invalid syntax
InvalidHostname
Invalid hostname
InvalidInternetHost
Invalid Internet hostname/address
Iso8601TimeNoSp
A wall-clock time, encoded in ISO8601 format without an intervening space.
Iso8601TimeSp
A wall-clock time, encoded in Iso8601 format with an intervening space between the date and time.
LongIdent
A “long identity” in the format used for Family members.
RetainedOrderVec
A sequence of T items, with their order retained
RsaPublicParse1Helper
RSA public key, partially processed by crate::paarse.
RsaSha1Signature
RSA signature using SHA-1 as per “Signing documents” in dir-spec
SpFingerprint
A hex-encoded RSA key identity (fingerprint) with spaces in it.
UnvalidatedEdCert
An ed25519 certificate as parsed from a directory object, with signature not validated.

Enums§

Ed25519AlgorithmString
Helper that checks for the presence of ed25519.
F64FiniteParseError
Error parsing F64Finite from a string
InternetHost
Hostname, or IP address (v4 or v6)
KeywordOrString
Known keyword (enum) value, or arbitrary string
Unknown
Information about unknown values, which may have been retained as a T

Constants§

ISO_8601NOSP_FMT
Formatting object for parsing the space-separated Iso8601 format.
ISO_8601SP_FMT
Formatting object for parsing the space-separated Iso8601 format.
RSA_FIXED_EXPONENT
The fixed exponent which we require when parsing any RSA key in a netdoc
RSA_MIN_BITS
The fixed exponent which we require when parsing any RSA key in a netdoc

Traits§

FromBytes 🔒
Describes a value that van be decoded from a bunch of bytes.

Functions§

fmt_with
Formats a SystemTime according to the given format description
parse_hex_ident
Helper: parse an identity from a hexadecimal string
write_b16u
Write b to f in hex uppercase