pub struct PostId(/* private fields */);Expand description
Unique identifier for a post.
Implementations§
Trait Implementations§
impl Copy for PostId
Source§impl<'de> Deserialize<'de> for PostId
impl<'de> Deserialize<'de> for PostId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PostId
Source§impl From<PostId> for ModerationTargetId
Anything that can be moderated narrows to a ModerationTargetId.
impl From<PostId> for ModerationTargetId
Anything that can be moderated narrows to a ModerationTargetId.
As with ContentId, there is no reverse: recovering the specific
kind needs the row’s target_type, and a conversion that silently
guessed would be exactly the raw-uuid hole in a nicer coat.
Source§impl From<PostId> for ContentId
A ContentId can be produced from anything already known to be
content — narrowing to “an id” from “an id we resolved” is always
sound. The reverse needs a database lookup and is
resolve_content_id’s job, which is why there is no From for it.
impl From<PostId> for ContentId
A ContentId can be produced from anything already known to be
content — narrowing to “an id” from “an id we resolved” is always
sound. The reverse needs a database lookup and is
resolve_content_id’s job, which is why there is no From for it.
Source§impl From<PostId> for PostOrCommentId
impl From<PostId> for PostOrCommentId
Source§impl FromStr for PostId
Every id round-trips through its own Display.
impl FromStr for PostId
Every id round-trips through its own Display.
Without this, anything that parses an id from a string — clap
value_parsers, query strings, config files — has to widen the
field back to a bare Uuid at the boundary and convert by
hand, which is the exact laundering the newtype exists to
prevent. agora-cli carried a hand-written
parse_moderation_action_id for precisely this reason.