pub struct ContentIdPrefix(/* private fields */);Expand description
The short form of a post or comment id: the first eight hex digits of
its UUID, e.g. 7ad26ccd.
Long lists of ids (a scheduling thread naming every eligible proposal)
read far better short, and people already write them that way. A prefix
is not an id: it may match nothing, or — rarely, at 32 bits over the
whole content table — more than one row. Only the server can say which,
so this type claims nothing beyond its shape, and every lookup must be
ready for an ambiguous answer. ContentIdPrefix::bounds gives the
inclusive UUID range it covers, for an index-friendly BETWEEN.
Parsing is lenient on case and surrounding whitespace; the canonical form is lowercase. It is exactly eight digits and nothing else: a truncated or mangled full UUID is an error, never quietly read as the prefix it starts with.
Implementations§
Trait Implementations§
Source§impl Clone for ContentIdPrefix
impl Clone for ContentIdPrefix
impl Copy for ContentIdPrefix
Source§impl Debug for ContentIdPrefix
impl Debug for ContentIdPrefix
Source§impl<'de> Deserialize<'de> for ContentIdPrefix
impl<'de> Deserialize<'de> for ContentIdPrefix
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 ContentIdPrefix
impl Display for ContentIdPrefix
impl Eq for ContentIdPrefix
Source§impl From<ContentId> for ContentIdPrefix
impl From<ContentId> for ContentIdPrefix
Source§impl From<ContentIdPrefix> for ContentRef
impl From<ContentIdPrefix> for ContentRef
Source§fn from(prefix: ContentIdPrefix) -> Self
fn from(prefix: ContentIdPrefix) -> Self
Source§impl FromStr for ContentIdPrefix
impl FromStr for ContentIdPrefix
Source§impl Hash for ContentIdPrefix
impl Hash for ContentIdPrefix
Source§impl Ord for ContentIdPrefix
impl Ord for ContentIdPrefix
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 ContentIdPrefix
impl PartialEq for ContentIdPrefix
Source§impl PartialOrd for ContentIdPrefix
impl PartialOrd for ContentIdPrefix
Source§impl Serialize for ContentIdPrefix
impl Serialize for ContentIdPrefix
impl StructuralPartialEq for ContentIdPrefix
Auto Trait Implementations§
impl Freeze for ContentIdPrefix
impl RefUnwindSafe for ContentIdPrefix
impl Send for ContentIdPrefix
impl Sync for ContentIdPrefix
impl Unpin for ContentIdPrefix
impl UnsafeUnpin for ContentIdPrefix
impl UnwindSafe for ContentIdPrefix
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.