Struct tor_geoip::CountryCode
source · pub struct CountryCode { /* private fields */ }
Expand description
A two-letter country code.
Specifically, this type represents a purported “ISO 3166-1 alpha-2” country code, such as “IT” for Italy or “UY” for Uruguay.
It does not include the sentinel value ??
that we use to represent
“country unknown”; if you need that, use OptionCc
. Other than that, we
do not check whether the country code represents a real country: we only
ensure that it is a pair of printing ASCII characters.
Note that the geoip databases included with Arti will only include real
countries; we do not include the pseudo-countries A1
through An
for
“anonymous proxies”, since doing so would mean putting nearly all Tor relays
into one of those countries.
Implementations§
Trait Implementations§
source§impl AsRef<str> for CountryCode
impl AsRef<str> for CountryCode
source§impl Clone for CountryCode
impl Clone for CountryCode
source§fn clone(&self) -> CountryCode
fn clone(&self) -> CountryCode
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 CountryCode
impl Debug for CountryCode
source§impl Display for CountryCode
impl Display for CountryCode
source§impl FromStr for CountryCode
impl FromStr for CountryCode
source§impl PartialEq for CountryCode
impl PartialEq for CountryCode
source§fn eq(&self, other: &CountryCode) -> bool
fn eq(&self, other: &CountryCode) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for CountryCode
impl Eq for CountryCode
impl StructuralPartialEq for CountryCode
Auto Trait Implementations§
impl Freeze for CountryCode
impl RefUnwindSafe for CountryCode
impl Send for CountryCode
impl Sync for CountryCode
impl Unpin for CountryCode
impl UnwindSafe for CountryCode
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