Skip to main content

Module types

Module types 

Source
Expand description

Various types that can occur in parsed network documents.

Some of the types are parsing adapters: transparent newtypes that can be used for type-driven parsing in netdocs. These are needed (rather than using the underlying value type) in cases where network documents have different syntaxes for the same thing.

NOTE: Several of these modules may eventually move elsewhere, or become their own crates.

Modules§

embedded_cert 🔒
Types related to certificates
family
Implements the relay ‘family’ type.
misc 🔒
Types used to parse arguments of entries in a directory document.
parse2_encode 🔒
Helpers for parse2 and encode
policy
Exit policies: match patterns of addresses and/or ports.
raw_data_object
Conversion module for Vec<u8> as Object with ItemValueParseable/ItemValueEncodable
relay_flags
Relay flags (aka Router Status Flags), eg in network status documents
routerdesc
Types for router descriptors.
version
Parsing and comparison for Tor versions

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
Ed25519IdentityLine
An Ed25519 public key found in a micro descriptor id line.
Ed25519Public
An alleged ed25519 public key, encoded in base64 with optional padding.
EmbeddedCert
One certificate inside a netdoc, covering data other than the netdoc itself
Fingerprint
A hex-encoded fingerprint with no spaces.
FixedB64
A byte array encoded in a hexadecimal with a fixed length.
FixedB16U
A fixed-length version of B16U.
Hostname
Internet hostname
IdentifiedDigest
A single digest made with a nominated digest algorithm, ALGORITHM=DIGEST
Ignored
Ignored part of a network document.
IgnoredItemOrObjectValue
An Item or Object that would be ignored during parsing and is omitted during encoding
InvalidHostname
Invalid hostname
InvalidInternetHost
Invalid Internet hostname/address
InvalidNickname
Invalid nickname
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.
Nickname
The nickname for a Tor relay.
NotPresent
Part of a network document, that isn’t actually there.
NumericBoolean
A boolean that is represented by a 0 (false) or 1 (true).
RetainedOrderVec
A sequence of T items, with their order retained
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.

Enums§

DigestName
The name of a digest algorithm.
Ed25519AlgorithmString
Helper that checks for the presence of ed25519.
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

Traits§

EmbeddableCertObject
Certificate data whose unverified form UR is representable as a netdoc Object