Trait rawr::traits::Distinguishable
[−]
[src]
pub trait Distinguishable { fn distinguished(&self) -> Option<String>; fn distinguish(&mut self) -> Result<(), APIError>; fn undistinguish(&mut self) -> Result<(), APIError>; fn toggle_distinguish(&mut self) -> Result<(), APIError> { ... } }
An object that can be distinguished (moderator/admin/special indicator).
Required Methods
fn distinguished(&self) -> Option<String>
Indicates whether the user has used a special flag for themselves, e.g. [M] or [A]. Possible values:
None
- Normal userSome("moderator")
- [M]Some("admin")
- [A]Some("special")
- other special 'distinguishes' e.g. [Δ]
fn distinguish(&mut self) -> Result<(), APIError>
Sets the post to have a [M] distinguish.
fn undistinguish(&mut self) -> Result<(), APIError>
Removes any distinguish on the comment. This will also unsticky a comment, if it is stickied.
Provided Methods
fn toggle_distinguish(&mut self) -> Result<(), APIError>
Distinguishes if undistinguished, and vice versa.
Implementors
impl<'a> Distinguishable for Comment<'a>
impl<'a> Distinguishable for Submission<'a>