pub struct CommunityName { /* private fields */ }Expand description
A community’s name as given, and the canonical name it stands for. See the module docs for which of the two each operation uses, and why.
Implementations§
Source§impl CommunityName
impl CommunityName
Sourcepub fn new(given: impl Into<String>) -> Result<Self, CommunityNameError>
pub fn new(given: impl Into<String>) -> Result<Self, CommunityNameError>
The name as written, with its canonical form worked out. Refused only when nothing is left: whether the community exists is the server’s question, answered with the names that do.
Sourcepub fn as_given(&self) -> &str
pub fn as_given(&self) -> &str
The name exactly as it was given: what serializes, and what a signature over a payload carrying it covers
Sourcepub fn is_canonical(&self) -> bool
pub fn is_canonical(&self) -> bool
Whether the name was given in its canonical spelling
Sourcepub fn into_canonical(self) -> Self
pub fn into_canonical(self) -> Self
The same name, given canonically: what a signer should sign
Trait Implementations§
Source§impl Borrow<str> for CommunityName
By canonical name, consistent with Eq, Hash and Ord, so a map keyed by
community name can be indexed with a &str
impl Borrow<str> for CommunityName
By canonical name, consistent with Eq, Hash and Ord, so a map keyed by
community name can be indexed with a &str
Source§impl Clone for CommunityName
impl Clone for CommunityName
Source§impl Debug for CommunityName
impl Debug for CommunityName
Source§impl<'de> Deserialize<'de> for CommunityName
impl<'de> Deserialize<'de> for CommunityName
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Display for CommunityName
The name as given: what was asked for, in messages about it
impl Display for CommunityName
The name as given: what was asked for, in messages about it
impl Eq for CommunityName
Source§impl FromStr for CommunityName
impl FromStr for CommunityName
Source§impl HasBytes for CommunityName
garde’s length(bytes, …) counts the name as written
impl HasBytes for CommunityName
garde’s length(bytes, …) counts the name as written
Source§impl Hash for CommunityName
impl Hash for CommunityName
Source§impl Ord for CommunityName
impl Ord for CommunityName
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CommunityName
impl PartialEq for CommunityName
Source§impl PartialEq<&str> for CommunityName
impl PartialEq<&str> for CommunityName
Source§impl PartialEq<str> for CommunityName
Against the canonical name: name == "meta-governance" holds for a name
given as meta/governance
impl PartialEq<str> for CommunityName
Against the canonical name: name == "meta-governance" holds for a name
given as meta/governance
Source§impl PartialOrd for CommunityName
impl PartialOrd for CommunityName
Source§impl Serialize for CommunityName
impl Serialize for CommunityName
Source§impl TryFrom<&str> for CommunityName
impl TryFrom<&str> for CommunityName
Auto Trait Implementations§
impl Freeze for CommunityName
impl RefUnwindSafe for CommunityName
impl Send for CommunityName
impl Sync for CommunityName
impl Unpin for CommunityName
impl UnsafeUnpin for CommunityName
impl UnwindSafe for CommunityName
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
fn validate_matches(&self, other: &O) -> bool
impl<T> PendingHandle for Twhere
T: Send + 'static,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more