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_ Bytes Transparent - Implement
ConstantTimeEq,.as_bytes(), etc., for a transparent newtype around bytes - derive_
deftly_ 🔒template_ Fixed Bytes - 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
- Base64
Fingerprint - A base64-encoded fingerprint (unpadded)
- Contact
Info contactitem: contact information (eg of a relay dirauth operator)- Curve25519
Public - A Curve25519 public key, encoded in base64 with optional padding
- Ed25519
Family Cert - An Ed25519 family certificate.
- Ed25519
Identity Cert - An Ed25519 identity certificate.
- Ed25519
Identity Line - Ed25519 public key in the form
<keyword> id <base64> - Ed25519
Ntor Cross Cert - Verified reverse cert by K_ntor on KP_relayid_ed
- Ed25519
Public - An alleged ed25519 public key, encoded in base64 with optional padding.
- F64Finite
- A finite floating point number
- F64Finite
Error - Error converting an
F64Finitefrom anf64: the value wasn’t finite - Fingerprint
- A hex-encoded fingerprint with no spaces.
- Fixed
B64 - A byte array encoded in base64 with a fixed length.
- Fixed
B16U - A fixed-length version of
B16U. - Hostname
- Internet hostname
- Invalid
Contact Info - Contact information (
contactitem value) has invalid syntax - Invalid
Hostname - Invalid hostname
- Invalid
Internet Host - Invalid Internet hostname/address
- Iso8601
Time NoSp - A wall-clock time, encoded in ISO8601 format without an intervening space.
- Iso8601
Time Sp - A wall-clock time, encoded in Iso8601 format with an intervening space between the date and time.
- Long
Ident - A “long identity” in the format used for Family members.
- Retained
Order Vec - A sequence of
Titems, with their order retained - RsaPublic
Parse1 Helper - RSA public key, partially processed by
crate::paarse. - RsaSha1
Signature - RSA signature using SHA-1 as per “Signing documents” in dir-spec
- SpFingerprint
- A hex-encoded RSA key identity (fingerprint) with spaces in it.
- Unvalidated
EdCert - An ed25519 certificate as parsed from a directory object, with signature not validated.
Enums§
- Ed25519
Algorithm String - Helper that checks for the presence of
ed25519. - F64Finite
Parse Error - Error parsing
F64Finitefrom a string - Internet
Host - Hostname, or IP address (v4 or v6)
- Keyword
OrString - 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§
- From
Bytes 🔒 - 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
btofin hex uppercase